Flakes, but it doesn't work 😞
This commit is contained in:
parent
50cb3fabb7
commit
c59fd9a5a7
16 changed files with 206 additions and 220 deletions
45
flake.nix
Normal file
45
flake.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
description = "Nixos configuration flake";
|
||||
|
||||
inputs = {
|
||||
nixpkgs = { url = "github:charvp/nixpkgs/master"; };
|
||||
home-manager = {
|
||||
url = "github:ehmry/home-manager/flake";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
flake-utils = { url = "github:numtide/flake-utils/master"; };
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, home-manager, flake-utils }:
|
||||
let
|
||||
pkgsFor = system: import nixpkgs {
|
||||
inherit system;
|
||||
config = { allowUnfree = true; };
|
||||
};
|
||||
mkSystem = system: hostname: nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [
|
||||
home-manager.nixosModules.home-manager
|
||||
(./. + "/machines/${hostname}")
|
||||
];
|
||||
};
|
||||
in
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = pkgsFor system;
|
||||
in
|
||||
{
|
||||
devShell = pkgs.mkShell {
|
||||
buildInputs = with nixpkgs.legacyPackages.${system}; [
|
||||
jq
|
||||
nixUnstable
|
||||
nixpkgs-fmt
|
||||
];
|
||||
};
|
||||
}) // {
|
||||
nixosConfigurations = {
|
||||
kharbranth = mkSystem "x86_64-linux" "kharbranth";
|
||||
kholinar = mkSystem "x86_64-linux" "kholinar";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue