-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
executable file
·121 lines (104 loc) · 3.84 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{
description = "Configuration of My NixOS Foo";
nixConfig = {
# append the default substituters
extra-substituters = [
"https://cache.garnix.io"
"https://niri.cachix.org"
# nix community's cache server
"https://nix-community.cachix.org"
];
extra-trusted-public-keys = [
"niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964="
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
inputs = {
# Specify the source of Home Manager and Nixpkgs.
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
#url = "github:nix-community/nixvim";
# If you are not running an unstable channel of nixpkgs, select the corresponding branch of nixvim.
url = "github:nix-community/nixvim/nixos-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
daeuniverse.url = "github:daeuniverse/flake.nix/f3068382eb9c3aa2e1c17749a6179141a3cd7381";
impermanence.url = "github:nix-community/impermanence";
my-nur = {
url = "github:msqtt/nur-packages";
inputs.nixpkgs.follows = "nixpkgs";
};
niri.url = "github:sodiboo/niri-flake";
plasma-manager = {
url = "github:nix-community/plasma-manager";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
};
outputs = { nixpkgs, home-manager, ... } @inputs:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
my-nurpkgs = inputs.my-nur.legacyPackages.${system};
overlays = builtins.attrValues my-nurpkgs.overlays
++ [
(final: prev: let pkgs-unstable = (import inputs.nixpkgs-unstable { system = final.system; }); in {
plasmusic-toolbar = pkgs-unstable.plasmusic-toolbar;
application-title-bar = pkgs-unstable.application-title-bar;
polonium = pkgs-unstable.polonium;
})
] ++ (with inputs; [ niri.overlays.niri ]);
specialArgs = { inherit inputs; my-nur = my-nurpkgs; };
in
{
formatter.x86_64-linux = pkgs.nixpkgs-fmt;
nixosConfigurations.foo = nixpkgs.lib.nixosSystem {
specialArgs = specialArgs;
modules = [
# substituters
{
nix.settings.trusted-users = [ "bob" ];
nix.settings = {
substituters = [
# cache mirror located in China
# status: https://mirror.sjtu.edu.cn/
# "https://mirror.sjtu.edu.cn/nix-channels/store"
# status: https://mirrors.ustc.edu.cn/status/
"https://mirrors.ustc.edu.cn/nix-channels/store"
"https://cache.nixos.org"
];
};
}
{
nixpkgs = {
config.allowUnfree = true;
overlays = overlays;
};
}
# system config
./nixos/configuration.nix
# home config
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = specialArgs;
home-manager.users.bob.imports = [ ./home-manager/home.nix ];
home-manager.sharedModules = with inputs; [ plasma-manager.homeManagerModules.plasma-manager ];
}
] ++ (with inputs; [
# other nixos modules
daeuniverse.nixosModules.daed
impermanence.nixosModules.impermanence
nixvim.nixosModules.nixvim
niri.nixosModules.niri
]);
};
};
}