flake update
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
{
|
||||
description = "NixOS + Home Manager flake (root)";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-25.11";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
todo.url = "github:sioodmy/todo";
|
||||
|
||||
zen-browser = {
|
||||
url = "github:0xc000022070/zen-browser-flake";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.home-manager.follows = "home-manager";
|
||||
};
|
||||
|
||||
# Per-user settings (override locally; keep stub tracked)
|
||||
personal = {
|
||||
url = "path:./personal.stub.nix";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Per-machine hardware config (override locally; keep stub tracked)
|
||||
hw = {
|
||||
url = "path:./nixos/hardware-stub.nix";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs@{ self, nixpkgs, home-manager, ... }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
|
||||
personal = import inputs.personal;
|
||||
|
||||
username = personal.username or "krosh";
|
||||
host = personal.host or "loki-nixos";
|
||||
|
||||
gitName = personal.gitName or "Dmitrii Gudov";
|
||||
gitEmail = personal.gitEmail or "gudovdo@my.msu.ru";
|
||||
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
homeConfigurations.${username} =
|
||||
home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
modules = [ ./home-manager/home.nix ];
|
||||
extraSpecialArgs = { inherit inputs username gitName gitEmail; };
|
||||
};
|
||||
|
||||
nixosConfigurations.${host} = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
|
||||
# if your NixOS modules want these too
|
||||
specialArgs = { inherit inputs username gitName gitEmail; };
|
||||
|
||||
modules = [
|
||||
# hardware-configuration comes from `inputs.hw`
|
||||
inputs.hw
|
||||
|
||||
./nixos/configuration.nix
|
||||
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
home-manager.users.${username} = import ./home-manager/home.nix;
|
||||
home-manager.extraSpecialArgs = {
|
||||
inherit inputs username gitName gitEmail;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Generated
-213
@@ -1,213 +0,0 @@
|
||||
{
|
||||
"nodes": {
|
||||
"fenix": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"todo",
|
||||
"nixpkgs"
|
||||
],
|
||||
"rust-analyzer-src": "rust-analyzer-src"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1649140024,
|
||||
"narHash": "sha256-SZLyRjOqmCevSFlxLvV6Zy/Hzu4AfYmZQqerLBNJa8A=",
|
||||
"owner": "nix-community",
|
||||
"repo": "fenix",
|
||||
"rev": "2af3ac5c6ee0e353e055241e21ca4710714a1394",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "fenix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1648199409,
|
||||
"narHash": "sha256-JwPKdC2PoVBkG6E+eWw3j6BMR6sL3COpYWfif7RVb8Y=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "64a525ee38886ab9028e6f61790de0832aa3ef03",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1648297722,
|
||||
"narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "0f8662f1319ad6abf89b3380dd2722369fc51ade",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1765605144,
|
||||
"narHash": "sha256-RM2xs+1HdHxesjOelxoA3eSvXShC8pmBvtyTke4Ango=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "90b62096f099b73043a747348c11dbfcfbdea949",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "release-25.11",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"naersk": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1649096192,
|
||||
"narHash": "sha256-7O8e+eZEYeU+ET98u/zW5epuoN/xYx9G+CIh4DjZVzY=",
|
||||
"owner": "nmattia",
|
||||
"repo": "naersk",
|
||||
"rev": "d626f73332a8f587b613b0afe7293dd0777be07d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nmattia",
|
||||
"repo": "naersk",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1765311797,
|
||||
"narHash": "sha256-mSD5Ob7a+T2RNjvPvOA1dkJHGVrNVl8ZOrAwBjKBDQo=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "09eb77e94fa25202af8f3e81ddc7353d9970ac1b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-25.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1648219316,
|
||||
"narHash": "sha256-Ctij+dOi0ZZIfX5eMhgwugfvB+WZSrvVNAyAuANOsnQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "30d3d79b7d3607d56546dd2a6b49e156ba0ec634",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1648219316,
|
||||
"narHash": "sha256-Ctij+dOi0ZZIfX5eMhgwugfvB+WZSrvVNAyAuANOsnQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "30d3d79b7d3607d56546dd2a6b49e156ba0ec634",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"home-manager": "home-manager",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"todo": "todo",
|
||||
"zen-browser": "zen-browser"
|
||||
}
|
||||
},
|
||||
"rust-analyzer-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1649102917,
|
||||
"narHash": "sha256-xBjxve7+0sIYlxlGLHjJV0DNmNC6GFlvLT+ura1cht8=",
|
||||
"owner": "rust-analyzer",
|
||||
"repo": "rust-analyzer",
|
||||
"rev": "5a6918f1c4e9d4f0c6a655e6283470f64edd64cf",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "rust-analyzer",
|
||||
"ref": "nightly",
|
||||
"repo": "rust-analyzer",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"todo": {
|
||||
"inputs": {
|
||||
"fenix": "fenix",
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-utils": "flake-utils",
|
||||
"naersk": "naersk",
|
||||
"nixpkgs": "nixpkgs_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1742851551,
|
||||
"narHash": "sha256-Kpa9f2MVduKjS9uHhj8qqO94XfF04zHlV/wXncB3umw=",
|
||||
"owner": "sioodmy",
|
||||
"repo": "todo",
|
||||
"rev": "02a002153a4536a15a9fd3b5ddbeed93aff80780",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "sioodmy",
|
||||
"repo": "todo",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"zen-browser": {
|
||||
"inputs": {
|
||||
"home-manager": [
|
||||
"home-manager"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1765589985,
|
||||
"narHash": "sha256-jsaE3UG7BpthBJZtaXCCuH1rYdQBauUA3Otv3NF20FM=",
|
||||
"owner": "0xc000022070",
|
||||
"repo": "zen-browser-flake",
|
||||
"rev": "c79311e5b4f299ab3713b23dfbc98c853bb5f070",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "0xc000022070",
|
||||
"repo": "zen-browser-flake",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
# NixOS
|
||||
sudo nixos-rebuild switch --flake .#myhost \
|
||||
--override-input personal path:/home/$USER/.config/nix/personal.nix \
|
||||
--override-input hw path:/etc/nixos/hardware-configuration.nix
|
||||
|
||||
# Home Manager only
|
||||
home-manager switch --flake .#$(nix eval --raw --expr '(import ./personal.stub.nix).username') \
|
||||
--override-input personal path:/home/$USER/.config/nix/personal.nix
|
||||
@@ -0,0 +1,7 @@
|
||||
{ ... }: {
|
||||
assertions = [{
|
||||
assertion = false;
|
||||
message =
|
||||
"Override hw: --override-input hw path:/etc/nixos/hardware-configuration.nix";
|
||||
}];
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
username = "krosh";
|
||||
host = "myhost";
|
||||
|
||||
gitName = "Dmitrii Gudov";
|
||||
gitEmail = "gudovdo@my.msu.ru";
|
||||
}
|
||||
@@ -18,6 +18,7 @@ mkdir -p "$DEST_FOLDER"
|
||||
cp -a "$SRC_FOLDER/." "$DEST_FOLDER/"
|
||||
|
||||
echo "Running home-manager switch..."
|
||||
nix flake update "$DEST_FOLDER"
|
||||
home-manager switch --flake ~/.config/home-manager
|
||||
|
||||
echo "Done! Backup (if any) stored at $BACKUP_DIR"
|
||||
|
||||
Reference in New Issue
Block a user