2024-08-04 23:45:01 +05:30
|
|
|
{
|
|
|
|
description = "My homebrew NixOS configurations";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = github:nixos/nixpkgs/nixos-unstable;
|
|
|
|
|
|
|
|
home-manager = {
|
|
|
|
url = github:nix-community/home-manager;
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
nixvim = {
|
|
|
|
url = github:nix-community/nixvim;
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2024-08-06 18:26:59 +05:30
|
|
|
plasma-manager = {
|
|
|
|
url = github:nix-community/plasma-manager;
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2024-08-15 03:09:28 +05:30
|
|
|
nur.url = github:nix-community/NUR;
|
|
|
|
nethack.url = git+https://git.psf.lt/xezo360hye/nethack?shallow=1;
|
2024-08-04 23:45:01 +05:30
|
|
|
};
|
|
|
|
|
2024-08-15 03:09:28 +05:30
|
|
|
outputs = {
|
|
|
|
self,
|
|
|
|
nixpkgs,
|
|
|
|
home-manager,
|
|
|
|
nixvim,
|
|
|
|
nethack,
|
|
|
|
plasma-manager,
|
|
|
|
nur,
|
|
|
|
...
|
|
|
|
} @ inputs:
|
2024-08-04 23:45:01 +05:30
|
|
|
let
|
2024-08-06 04:28:25 +05:30
|
|
|
inherit (nixpkgs) lib;
|
2024-08-04 23:45:01 +05:30
|
|
|
|
|
|
|
username = "andrey";
|
|
|
|
hostnames = [ "tokishiko" "maidena" ];
|
2024-08-06 04:28:25 +05:30
|
|
|
stateVersion = "24.05";
|
2024-08-04 23:45:01 +05:30
|
|
|
|
2024-08-06 04:28:25 +05:30
|
|
|
makeSystem = hostname: {
|
2024-08-04 23:45:01 +05:30
|
|
|
"${hostname}" = nixpkgs.lib.nixosSystem {
|
|
|
|
specialArgs = { inherit inputs; };
|
|
|
|
modules = [
|
2024-08-11 19:51:29 +05:30
|
|
|
nur.nixosModules.nur
|
|
|
|
|
2024-08-05 02:23:28 +05:30
|
|
|
./system/common.nix
|
2024-08-04 23:45:01 +05:30
|
|
|
./system/${hostname}.nix
|
|
|
|
./hardware/${hostname}.nix
|
2024-08-11 19:51:29 +05:30
|
|
|
|
2024-08-06 04:28:25 +05:30
|
|
|
{
|
|
|
|
system.stateVersion = stateVersion;
|
|
|
|
networking.hostName = hostname;
|
|
|
|
}
|
2024-08-04 23:45:01 +05:30
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-08-15 03:09:28 +05:30
|
|
|
|
|
|
|
makeHome = hostname:
|
|
|
|
let
|
|
|
|
extractModules = map
|
|
|
|
(module:
|
|
|
|
let hm = module.homeManagerModules;
|
|
|
|
in hm.${lib.head (lib.attrNames hm)});
|
|
|
|
in
|
|
|
|
{
|
|
|
|
"${username}@${hostname}" = home-manager.lib.homeManagerConfiguration
|
|
|
|
{
|
|
|
|
extraSpecialArgs = { inherit inputs; };
|
2024-08-11 19:51:29 +05:30
|
|
|
pkgs = import nixpkgs {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
overlays = [ nur.overlay ];
|
|
|
|
};
|
2024-08-15 03:09:28 +05:30
|
|
|
|
|
|
|
modules = (extractModules [
|
|
|
|
nixvim
|
|
|
|
nethack
|
|
|
|
plasma-manager
|
|
|
|
]) ++ [
|
2024-08-11 19:51:29 +05:30
|
|
|
nur.hmModules.nur
|
|
|
|
|
2024-08-04 23:45:01 +05:30
|
|
|
./home/${hostname}.nix
|
2024-08-05 02:49:38 +05:30
|
|
|
./home/common.nix
|
2024-08-11 19:51:29 +05:30
|
|
|
|
2024-08-06 04:28:25 +05:30
|
|
|
{
|
|
|
|
news.display = "show";
|
|
|
|
home.username = username;
|
|
|
|
home.homeDirectory = "/home/${username}";
|
|
|
|
home.stateVersion = stateVersion;
|
|
|
|
}
|
2024-08-04 23:45:01 +05:30
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-08-17 21:43:24 +05:30
|
|
|
forEachHost = fn: lib.mergeAttrsList (map fn hostnames);
|
2024-08-04 23:45:01 +05:30
|
|
|
in {
|
2024-08-06 04:28:25 +05:30
|
|
|
nixosConfigurations = forEachHost makeSystem;
|
|
|
|
homeConfigurations = forEachHost makeHome;
|
2024-08-04 23:45:01 +05:30
|
|
|
};
|
|
|
|
}
|