refactor
This commit is contained in:
parent
8c9eed18e6
commit
b458b67238
83 changed files with 1115 additions and 5026 deletions
47
flake.nix
47
flake.nix
|
|
@ -1,16 +1,22 @@
|
|||
# flake.nix
|
||||
{
|
||||
description = "NixOS configuration";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable/";
|
||||
nixos-hardware.url = "github:NixOS/nixos-hardware/";
|
||||
|
||||
disko.url = "github:nix-community/disko";
|
||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
impermanence.url = "github:nix-community/impermanence";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ self, nixpkgs, home-manager, impermanence, ... } @ inputs:
|
||||
{ self, nixpkgs, home-manager, impermanence, disko, ... } @ inputs:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
username = "xory";
|
||||
|
|
@ -19,28 +25,33 @@
|
|||
|
||||
mkNixosHost = hostName:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
inherit system;
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
modules = [
|
||||
{ nixpkgs.overlays = [ opentrack-overlay ]; }
|
||||
impermanence.nixosModules.impermanence
|
||||
./hosts/${hostName}/configuration.nix
|
||||
./hosts/${hostName}/hardware-configuration.nix
|
||||
|
||||
home-manager.nixosModules.home-manager {
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.${username} = import ./hosts/${hostName}/home.nix;
|
||||
}
|
||||
];
|
||||
};
|
||||
disko.nixosModules.disko
|
||||
impermanence.nixosModules.impermanence
|
||||
|
||||
./configuration.nix
|
||||
./hosts/${hostName}/config.nix
|
||||
|
||||
home-manager.nixosModules.home-manager {
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = { inherit inputs; };
|
||||
# Imports the common home.nix from root
|
||||
home-manager.users.${username} = import ./home.nix;
|
||||
}
|
||||
];
|
||||
};
|
||||
in {
|
||||
nixosConfigurations = nixpkgs.lib.mapAttrs'
|
||||
(name: value: {
|
||||
name = name;
|
||||
value = mkNixosHost name;
|
||||
})
|
||||
(nixpkgs.lib.filterAttrs (name: value: value == "directory")
|
||||
name = name;
|
||||
value = mkNixosHost name;
|
||||
})
|
||||
(nixpkgs.lib.filterAttrs (name: value: value == "directory")
|
||||
(builtins.readDir ./hosts));
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue