diff --git a/configuration.nix b/configuration.nix index 8cc9e8f..2a5427c 100644 --- a/configuration.nix +++ b/configuration.nix @@ -8,7 +8,7 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix - + # ]; # Bootloader. @@ -16,11 +16,11 @@ boot.loader.efi.canTouchEfiVariables = true; boot.kernelPackages = pkgs.linuxPackages_latest; - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; + #home-manager.useGlobalPkgs = true; + #home-manager.useUserPackages = true; home-manager.backupFileExtension = "backup"; - home-manager.users.rainy = import ./home.nix; + #home-manager.users.rainy = import ./home.nix; networking.hostName = "rainix"; # Define your hostname. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. @@ -61,6 +61,16 @@ xkbVariant = ""; }; + # nix stuff + + nix.settings.experimental-features = ["nix-command" "flakes"]; + + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; + services.desktopManager.cosmic.enable = true; # Define a user account. Don't forget to set a password with ‘passwd’. diff --git a/flake.lock b/flake.lock index a7c801a..d487243 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,25 @@ { "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1745362344, + "narHash": "sha256-R4d7j2urn/W+K9crKJaxJvZOsVX5v7uCAymaDBq97SE=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "b99e3e46b86aefc01f229e0a29d0c03c1079aaed", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1745234285, @@ -18,6 +38,7 @@ }, "root": { "inputs": { + "home-manager": "home-manager", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index b3a6c02..e6442c1 100644 --- a/flake.nix +++ b/flake.nix @@ -3,12 +3,20 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { nixpkgs, ... }: { + outputs = { self, nixpkgs, home-manager, ... }@inputs: { nixosConfigurations.rainix = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - modules = [ ./configuration.nix ]; + modules = [ ./configuration.nix home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.rainy = import ./home.nix; + } ]; }; }; } diff --git a/home.nix b/home.nix index 0c37b63..ffcb352 100644 --- a/home.nix +++ b/home.nix @@ -23,6 +23,7 @@ pkgs.mangohud pkgs.gamescope pkgs.fastfetch + pkgs.upscayl ]; home.stateVersion = "25.05"; diff --git a/modules/fish.nix b/modules/fish.nix index 7eeaf7e..5c7904c 100644 --- a/modules/fish.nix +++ b/modules/fish.nix @@ -3,9 +3,9 @@ { programs.fish.enable = true; programs.fish.shellAliases = { - nxr = "sudo nixos-rebuild switch"; - nxe = "sudo nano /etc/nixos/configuration.nix"; - nxh = "sudo nano /etc/nixos/home.nix"; + nxr = "sudo nixos-rebuild switch --flake .#"; + nxe = "nano /home/rainy/nix-config/configuration.nix"; + nxh = "nano /home/rainy/nix-config/home.nix"; nxu = "sudo nix-channel --update && sudo nixos-rebuild switch --upgrade"; }; }