move home manager to flake

This commit is contained in:
rainy 2025-04-22 16:25:45 -07:00
parent 79e27c23c6
commit f42a67064a
5 changed files with 49 additions and 9 deletions

View File

@ -8,7 +8,7 @@
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
<home-manager/nixos>
#<home-manager/nixos>
];
# 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.

View File

@ -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"
}
}

View File

@ -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;
} ];
};
};
}

View File

@ -23,6 +23,7 @@
pkgs.mangohud
pkgs.gamescope
pkgs.fastfetch
pkgs.upscayl
];
home.stateVersion = "25.05";

View File

@ -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";
};
}