mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 15:11:34 +01:00
Modularize flake outputs
This commit is contained in:
parent
9b76581f82
commit
63f79df82b
4 changed files with 64 additions and 45 deletions
52
flake.nix
52
flake.nix
|
|
@ -52,52 +52,14 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
inputs:
|
{ flake-parts, ... }@inputs:
|
||||||
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||||
systems = [ "x86_64-linux" ];
|
systems = [ "x86_64-linux" ];
|
||||||
|
|
||||||
flake = {
|
imports = [
|
||||||
nixosConfigurations = {
|
./flake/nixosConfigurations.nix
|
||||||
north = inputs.nixpkgs.lib.nixosSystem {
|
./flake/devShells.nix
|
||||||
specialArgs = {
|
./flake/formatter.nix
|
||||||
inherit (inputs) self;
|
];
|
||||||
inherit inputs;
|
|
||||||
};
|
|
||||||
modules = [
|
|
||||||
./hosts/north
|
|
||||||
"${inputs.self}/users/seb/@north"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
inspiron = inputs.nixpkgs.lib.nixosSystem {
|
|
||||||
specialArgs = {
|
|
||||||
inherit (inputs) self;
|
|
||||||
inherit inputs;
|
|
||||||
};
|
|
||||||
modules = [
|
|
||||||
./hosts/inspiron
|
|
||||||
"${inputs.self}/users/seb/@inspiron"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
perSystem =
|
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
devShells.sops = pkgs.mkShell {
|
|
||||||
packages = [
|
|
||||||
pkgs.sops
|
|
||||||
pkgs.age
|
|
||||||
pkgs.ssh-to-age
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
formatter =
|
|
||||||
(inputs.treefmt-nix.lib.evalModule pkgs {
|
|
||||||
projectRootFile = "flake.nix";
|
|
||||||
programs.nixfmt.enable = true;
|
|
||||||
programs.prettier.enable = true;
|
|
||||||
}).config.build.wrapper;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
14
flake/devShells.nix
Normal file
14
flake/devShells.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
perSystem =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
devShells.sops = pkgs.mkShell {
|
||||||
|
packages = [
|
||||||
|
pkgs.sops
|
||||||
|
pkgs.age
|
||||||
|
pkgs.ssh-to-age
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
13
flake/formatter.nix
Normal file
13
flake/formatter.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
{ inputs, ... }:
|
||||||
|
{
|
||||||
|
perSystem =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
formatter =
|
||||||
|
(inputs.treefmt-nix.lib.evalModule pkgs {
|
||||||
|
projectRootFile = "flake.nix";
|
||||||
|
programs.nixfmt.enable = true;
|
||||||
|
programs.prettier.enable = true;
|
||||||
|
}).config.build.wrapper;
|
||||||
|
};
|
||||||
|
}
|
||||||
30
flake/nixosConfigurations.nix
Normal file
30
flake/nixosConfigurations.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
nixpkgs,
|
||||||
|
self,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
flake = {
|
||||||
|
nixosConfigurations = {
|
||||||
|
north = inputs.nixpkgs.lib.nixosSystem {
|
||||||
|
specialArgs = {
|
||||||
|
inherit self inputs;
|
||||||
|
};
|
||||||
|
modules = [
|
||||||
|
"${self}/hosts/north"
|
||||||
|
"${self}/users/seb/@north"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
inspiron = inputs.nixpkgs.lib.nixosSystem {
|
||||||
|
specialArgs = {
|
||||||
|
inherit self inputs;
|
||||||
|
};
|
||||||
|
modules = [
|
||||||
|
"${self}/hosts/inspiron"
|
||||||
|
"${self}/users/seb/@inspiron"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue