-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
76 lines (68 loc) · 2.58 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
{
description = "A simple NixOS flake";
inputs = {
# NixOS 官方软件源,这里使用 nixos-unstable 分支
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# helix editor, use the master branch
helix.url = "github:helix-editor/helix/master";
# ixpkgs.config.allowUnfree = true;
dedsec-grub-theme = {
url = "gitlab:VandalByte/dedsec-grub-theme";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland.url = "github:hyprwm/Hyprland";
hyprland-plugins = {
url = "github:hyprwm/hyprland-plugins";
inputs.hyprland.follows = "hyprland";
};
# community wayland nixpkgs
# nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
# anyrun - a wayland launcher
anyrun = {
url = "github:Kirottu/anyrun";
inputs.nixpkgs.follows = "nixpkgs";
};
nur-ryan4yin = {
url = "github:ryan4yin/nur-packages";
# inputs.nixpkgs.follows = "nixpkgs";
};
};
# the nixConfig here only affects the flake itself, not the system configuration!
# for more information, see:
# https://nixos-and-flakes.thiscute.world/nixos-with-flakes/add-custom-cache-servers
nixConfig = {
# substituers will be appended to the default substituters when fetching packages
extra-substituters = [
"https://anyrun.cachix.org"
"https://hyprland.cachix.org"
# "https://nix-gaming.cachix.org"
# "https://nixpkgs-wayland.cachix.org"
];
extra-trusted-public-keys = [
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
# "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
# "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
];
};
# 这里的 `self` 是个特殊参数,它指向 `outputs` 函数返回的 attribute set 自身,即自引用
outputs = { self, nixpkgs, dedsec-grub-theme, home-manager, anyrun, hyprland, nur-ryan4yin, ... }@inputs:
let
inherit (self) outputs;
system = "x86_64-linux"; # System architecture
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true; # Allow proprietary software
};
in
{
homeManagerModules = import ./modules/home;
nixosConfigurations = {
"suzuha" = import ./hosts/suzuha-laptop { inherit nixpkgs dedsec-grub-theme home-manager hyprland nur-ryan4yin inputs anyrun outputs pkgs; };
};
};
}