diff --git a/nixos/extra/cnix.nix b/nixos/extra/gaming.nix similarity index 90% rename from nixos/extra/cnix.nix rename to nixos/extra/gaming.nix index dad769f0..de56f962 100644 --- a/nixos/extra/cnix.nix +++ b/nixos/extra/gaming.nix @@ -5,15 +5,9 @@ ./bottles ./gamemode ./gamescope - ./workstation ]; environment = { systemPackages = with pkgs; [ - # Dev - fd - python3 - hyprlang - # Misc protonup diff --git a/nixos/hardware/cnix.nix b/nixos/hardware/cnix.nix index 2ac813e0..05971152 100644 --- a/nixos/hardware/cnix.nix +++ b/nixos/hardware/cnix.nix @@ -1,10 +1,4 @@ -{ - pkgs, - lib, - config, - inputs, - ... -}: { +{pkgs, ...}: { zramSwap.enable = true; hardware = { diff --git a/nixos/hosts/cnix/default.nix b/nixos/hosts/cnix/default.nix index e32ebf05..70f74398 100644 --- a/nixos/hosts/cnix/default.nix +++ b/nixos/hosts/cnix/default.nix @@ -28,16 +28,14 @@ in { "gamemode" "adbusers" "rtkit" + "users" ]; }; imports = [ inputs.home-manager.nixosModules.home-manager - ../../core - ../../extra/cnix.nix - ../../services/cnix.nix - ../../hardware/cnix.nix - ../../locale/cnix.nix + ./imports.nix + ./system.nix ./hardware-configuration.nix ]; @@ -75,6 +73,7 @@ in { enable = true; pkiBundle = "/etc/secureboot"; }; + # Enable networking networking = { networkmanager.enable = true; @@ -85,16 +84,6 @@ in { FLAKE = "/home/cnst/.nix-config"; }; - # Garbage collector / Nix helper - programs = { - nh = { - enable = true; - clean.enable = true; - clean.extraArgs = "--keep-since 4d --keep 3"; - flake = "/home/cnst/.nix-config"; - }; - }; - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion system.stateVersion = "24.05"; } diff --git a/nixos/hosts/cnix/imports.nix b/nixos/hosts/cnix/imports.nix new file mode 100644 index 00000000..47378452 --- /dev/null +++ b/nixos/hosts/cnix/imports.nix @@ -0,0 +1,69 @@ +{pkgs, ...}: { + imports = [ + # core + ../../core/hyprland.nix + ../../core/adb.nix + ../../core/zsh.nix + ../../core/fonts.nix + + # hardware + ../../hardware/cnix.nix + + # locale + ../../locale/cnix.nix + + # services + ../../services/blueman.nix + ../../services/dbus.nix + ../../services/gnome-keyring.nix + ../../services/greetd.nix + ../../services/gvfs.nix + ../../services/mullvad.nix + ../../services/openssh.nix + ../../services/pipewire.nix + ../../services/udisks.nix + ../../services/xserver.nix + + # extra + ../../extra/gaming.nix + ../../extra/workstation + # ../../extra/nix-ld + ]; + + environment = { + systemPackages = with pkgs; [ + # Core + git + sbctl + niv + nix-output-monitor + nvd + fd + + # Util + stow + wget + curl + ripgrep + python3 + hyprlang + python312Packages.oauth2 + python312Packages.httplib2 + killall + tree-sitter + lazygit + tmux + tmuxifier + unzip + p7zip + unrar + xdg-utils + xdg-user-dirs + ntfs3g + gnome-disk-utility + wlroots + fzf + udiskie + ]; + }; +} diff --git a/nixos/hosts/cnix/system.nix b/nixos/hosts/cnix/system.nix new file mode 100644 index 00000000..abbc4898 --- /dev/null +++ b/nixos/hosts/cnix/system.nix @@ -0,0 +1,36 @@ +{ + inputs, + outputs, + ... +}: { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { + inherit inputs outputs; + }; + }; + nixpkgs = { + overlays = []; + config = { + allowUnfree = true; + input-fonts.acceptLicense = true; + }; + }; + + programs = { + nh = { + enable = true; + clean.enable = true; + clean.extraArgs = "--keep-since 4d --keep 3"; + flake = "/home/cnst/.nix-config"; + }; + dconf.enable = true; + }; + + security.rtkit.enable = true; + + environment.localBinInPath = true; + + console.useXkbConfig = true; +} diff --git a/nixos/services/blueman.nix b/nixos/services/blueman.nix new file mode 100644 index 00000000..89f77a33 --- /dev/null +++ b/nixos/services/blueman.nix @@ -0,0 +1 @@ +{services.blueman.enable = true;} diff --git a/nixos/services/cnix.nix b/nixos/services/cnix.nix index c59da6ad..515e6a70 100644 --- a/nixos/services/cnix.nix +++ b/nixos/services/cnix.nix @@ -6,13 +6,4 @@ ./openssh.nix ./mullvad.nix ]; - services = { - dbus.packages = with pkgs; [ - gcr - ]; - udisks2.enable = true; - gvfs.enable = true; - blueman.enable = true; - gnome.gnome-keyring.enable = true; - }; } diff --git a/nixos/services/dbus.nix b/nixos/services/dbus.nix new file mode 100644 index 00000000..5cd9edc6 --- /dev/null +++ b/nixos/services/dbus.nix @@ -0,0 +1,7 @@ +{pkgs, ...}: { + services = { + dbus.packages = with pkgs; [ + gcr + ]; + }; +} diff --git a/nixos/services/gnome-keyring.nix b/nixos/services/gnome-keyring.nix new file mode 100644 index 00000000..582f02f4 --- /dev/null +++ b/nixos/services/gnome-keyring.nix @@ -0,0 +1 @@ +{services.gnome.gnome-keyring.enable = true;} diff --git a/nixos/services/gvfs.nix b/nixos/services/gvfs.nix new file mode 100644 index 00000000..e57a99ff --- /dev/null +++ b/nixos/services/gvfs.nix @@ -0,0 +1 @@ +{services.gvfs.enable = true;} diff --git a/nixos/services/udisks.nix b/nixos/services/udisks.nix new file mode 100644 index 00000000..cad0b22a --- /dev/null +++ b/nixos/services/udisks.nix @@ -0,0 +1 @@ +{services.udisks2.enable = true;}