-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
106 lines (99 loc) · 2.73 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
{
description = "NixOS configuration";
# use a released version
inputs = {
nixpkgs.url = "nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
lanzaboote = {
url = "github:nix-community/lanzaboote";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
nixos-sbc.url = "github:nakato/nixos-sbc/main";
nixpkgs-wayland.inputs.nixpkgs.follows = "nixpkgs-unstable";
nixos-sbc.inputs.nixpkgs.follows = "nixpkgs-unstable";
};
outputs = { self, nixpkgs, nixos-hardware, nixpkgs-unstable, lanzaboote, nixos-sbc, ... }@attrs:
let
system = "x86_64-linux";
overlay-unstable-with-sway = final: prev: {
unstable = import nixpkgs-unstable {
system = "${prev.system}";
config.allowUnfreePredicate = pkg: builtins.elem (pkg.pname or (builtins.parseDrvName pkg.name).name) final.allowedUnfree;
# overlay for using unstable-sway in sway-and-friends
overlays = [ attrs.nixpkgs-wayland.overlay ];
};
};
mkSystem = {
name,
modules ? [],
extra ? {},
cfg ? {},
unstable ? false,
}: (if unstable then nixpkgs-unstable else nixpkgs).lib.nixosSystem {
inherit system;
modules = [
./modules/utils/allowedUnfree-polyfill.nix
./modules/common
./modules/user-facing
./modules/cache
./systems/${name}
({ ... }: { networking.hostName = name; })
({ config, pkgs, lib, ... }: {
config = lib.mkIf config.local.userFacing {
# make pkgs.unstable available in modules
nixpkgs.overlays = [ overlay-unstable-with-sway ];
};
})
({ ... }: cfg)
] ++ modules;
} // extra;
in rec {
# yasamin
nixosConfigurations.yasamin = mkSystem {
name = "yasamin";
modules = [
nixos-hardware.nixosModules.lenovo-thinkpad-x1-9th-gen
];
cfg = {
local.userFacing = true;
};
};
nixosConfigurations.yasamin-print = nixosConfigurations.yasamin // {
modules = nixpkgs.lib.mkAfter [
({ pkgs, ... }: {
services.printing.enable = true;
# enable wifi printing
services.avahi = {
enable = true;
nssmdns = true;
openFirewall = true;
};
})
];
};
# music.devices
nixosConfigurations.music = mkSystem {
name = "music";
cfg = {
local.userFacing = false;
};
};
# sanctuary-router
nixosConfigurations.sanctuary-router = mkSystem {
name = "sanctuary-router";
unstable = true;
modules = [
nixos-sbc.nixosModules.default
nixos-sbc.nixosModules.boards.bananapi.bpir4
nixos-sbc.nixosModules.cache
];
cfg = {
local.userFacing = false;
local.uefi = false;
local.networking = "systemd";
local.cache.enable = true;
};
};
};
}