diff --git a/home/Ricky/dev/Ricky.nix b/home/Ricky/dev/Ricky.nix new file mode 100644 index 0000000..8823a5e --- /dev/null +++ b/home/Ricky/dev/Ricky.nix @@ -0,0 +1,68 @@ +# This is your home-manager configuration file +# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix) +{ + inputs, + lib, + config, + pkgs, + ... +}: +let + username = "dev"; +in +{ + # You can import other home-manager modules here + imports = [ + # If you want to use modules your own flake exports (from modules/home-manager): + # inputs.self.homeManagerModules.example + + # Or modules exported from other flakes (such as nix-colors): + # inputs.nix-colors.homeManagerModules.default + + # You can also split up your configuration and import pieces of it here: + # ./nvim.nix + + #../common/features/niri/niri.nix + #../common/features/spicetify.nix + #../common/features/yazi/yazi.nix + #../common/features/nvimConf.nix + #../common/features/shell.nix + ]; + + nixpkgs = { + # You can add overlays here + overlays = [ + # Add overlays your own flake exports (from overlays and pkgs dir): + inputs.self.overlays.additions + inputs.self.overlays.modifications + inputs.self.overlays.unstable-packages + + # You can also add overlays exported from other flakes: + # neovim-nightly-overlay.overlays.default + + # Or define it inline, for example: + # (final: prev: { + # hi = final.hello.overrideAttrs (oldAttrs: { + # patches = [ ./change-hello-to-hi.patch ]; + # }); + # }) + ]; + # Configure your nixpkgs instance + config = { + # Disable if you don't want unfree packages + allowUnfree = true; + }; + }; + + home.packages = with pkgs; [ + ]; + + home = { + username = username; + homeDirectory = "/home/${username}"; + }; + programs.home-manager.enable = true; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + home.stateVersion = "25.11"; +} diff --git a/hosts/Ricky/configuration.nix b/hosts/Ricky/configuration.nix new file mode 100644 index 0000000..d0685a3 --- /dev/null +++ b/hosts/Ricky/configuration.nix @@ -0,0 +1,87 @@ +# This is your system's configuration file. +# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix) +{ + inputs, + lib, + config, + pkgs, + ... +}: +let + hostname = "Ricky"; +in +{ + # You can import other NixOS modules here + imports = [ + # If you want to use modules your own flake exports (from modules/nixos): + # inputs.self.nixosModules.example + + # Or modules from other flakes (such as nixos-hardware): + # inputs.hardware.nixosModules.common-cpu-amd + # inputs.hardware.nixosModules.common-ssd + + ./hardware-configuration.nix + + #../common/users/Winter/default.nix + ../common/users/dev/default.nix + #../common/global/default.nix + ../common/features/DesktopNiri.nix + #../common/features/Applications.nix + #../common/features/servers/minecraft.nix + + inputs.home-manager.nixosModules.home-manager + ]; + + nixpkgs = { + # You can add overlays here + overlays = [ + # Add overlays your own flake exports (from overlays and pkgs dir): + inputs.self.overlays.additions + inputs.self.overlays.modifications + inputs.self.overlays.unstable-packages + + # You can also add overlays exported from other flakes: + # neovim-nightly-overlay.overlays.default + + # Or define it inline, for example: + # (final: prev: { + # hi = final.hello.overrideAttrs (oldAttrs: { + # patches = [ ./change-hello-to-hi.patch ]; + # }); + # }) + ]; + # Configure your nixpkgs instance + config = { + # Disable if you don't want unfree packages + allowUnfree = true; + }; + }; + + # build home-manager with nixos-rebuild and not home-manager command + home-manager = { + extraSpecialArgs = { inherit inputs; }; + backupFileExtension = "backup"; + users = { + dev = import ../../home/Ricky/dev/${hostname}.nix; + }; + }; + + environment.systemPackages = with pkgs; [ + ]; + + networking.hostName = hostname; + + # This setups a SSH server. Very important if you're setting up a headless system. + # Feel free to remove if you don't need it. + #Unused, keeping for later reference + services.openssh = { + enable = false; + settings = { + PermitRootLogin = "no"; + PasswordAuthentication = false; + }; + }; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + system.stateVersion = "25.11"; +} diff --git a/hosts/Ricky/hardware-configuration.nix b/hosts/Ricky/hardware-configuration.nix new file mode 100644 index 0000000..565bda1 --- /dev/null +++ b/hosts/Ricky/hardware-configuration.nix @@ -0,0 +1,31 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/37e1fcd1-4321-4010-81f7-a3c1443d2a2d"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/AF44-E292"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/common/users/dev/default.nix b/hosts/common/users/dev/default.nix new file mode 100644 index 0000000..39103ad --- /dev/null +++ b/hosts/common/users/dev/default.nix @@ -0,0 +1,39 @@ +{ + pkgs, + config, + lib, + ... +}: let + username = "dev"; + ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups; +in { + users.users.${username} = { + isNormalUser = true; + extraGroups = ifTheyExist [ + "audio" + "deluge" + "docker" + "git" + "i2c" + "libvirtd" + "minecraft" + "mysql" + "wpa_supplicant" + "plugdev" + "podman" + "tss" + "video" + "wheel" + "wireshark" + ]; + + }; + +# TODO: ensure correct paths + home-manager.users.${username} = import ../../../../home/${username}/${config.networking.hostName}.nix; + + security.pam.services = { + swaylock = {}; + ${username}.enableGnomeKeyring = true; + }; +}