-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
70 lines (63 loc) · 1.88 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:nixos/nixos-hardware";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-index-database = {
url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ {
self,
nixpkgs,
treefmt-nix,
...
}: let
inherit (self) outputs;
specialArgs = {
inherit inputs outputs;
user = {
name = "Henri Rosten";
username = "hrosten";
homedir = "/home/hrosten";
email = "henri.rosten@unikie.com";
keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHFuB+uEjhoSdakwiKLD3TbNpbjnlXerEfZQbtRgvdSz"
];
};
};
in {
nixosModules = import ./nix-modules;
homeManagerModules = import ./home-modules;
nixosConfigurations = {
x1 = inputs.nixpkgs.lib.nixosSystem {
inherit specialArgs;
modules = [./hosts/x1/configuration.nix];
};
t480 = inputs.nixpkgs.lib.nixosSystem {
inherit specialArgs;
modules = [./hosts/t480/configuration.nix];
};
};
formatter.x86_64-linux =
treefmt-nix.lib.mkWrapper
nixpkgs.legacyPackages.x86_64-linux
{
projectRootFile = "flake.nix";
programs = {
alejandra.enable = true; # nix formatter https://github.com/kamadorueda/alejandra
deadnix.enable = true; # removes dead nix code https://github.com/astro/deadnix
statix.enable = true; # prevents use of nix anti-patterns https://github.com/nerdypepper/statix
shellcheck.enable = true; # lints shell scripts https://github.com/koalaman/shellcheck
};
};
};
}