-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
125 lines (109 loc) · 3.23 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
122
123
124
125
{
description = "Rodent NixOS configuration";
inputs = {
# Nixpkgs and unstable
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
# Flake-parts - Simplify Nix Flakes with the module system
# https://github.com/hercules-ci/flake-parts
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
# Home manager
# https://github.com/nix-community/home-manager
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
# Catppuccin
# https://github.com/catppuccin/nix
catppuccin = {
url = "github:catppuccin/nix";
};
# Krewfile
# https://github.com/brumhard/krewfile
krewfile = {
url = "github:brumhard/krewfile";
inputs.nixpkgs.follows = "nixpkgs";
};
# nix-darwin
# https://github.com/LnL7/nix-darwin
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
# nix-index-database
# https://github.com/nix-community/nix-index-database"
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
# WSL
nixos-wsl = {
url = "github:nix-community/NixOS-WSL/main";
inputs.nixpkgs.follows = "nixpkgs";
};
# NixVim
# https://github.com/nix-community/nixvim
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
};
# Rust toolchain overlay
# https://github.com/oxalica/rust-overlay
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
# sops-nix
# https://github.com/Mic92/sops-nix
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# Talhelper
# https://github.com/budimanjojo/talhelper
talhelper = {
url = "github:budimanjojo/talhelper";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{ flake-parts, ... }:
let
mkPkgsWithSystem =
system:
import inputs.nixpkgs {
inherit system;
overlays = builtins.attrValues (import ./overlays { inherit inputs system; });
config.allowUnfree = true;
};
mkSystemLib = import ./lib/mkSystem.nix { inherit inputs mkPkgsWithSystem; };
in
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ ];
systems = [
"x86_64-linux"
];
perSystem =
{
system,
pkgs,
...
}:
{
# override pkgs used by everything in `perSystem` to have my overlays
_module.args.pkgs = mkPkgsWithSystem system;
# accessible via `nix build .#<name>`
packages = import ./pkgs { inherit pkgs inputs; };
};
flake = {
nixosConfigurations = {
laptop = mkSystemLib.mkWslSystem "x86_64-linux" "laptop";
gamer = mkSystemLib.mkWslSystem "x86_64-linux" "gamer";
work = mkSystemLib.mkWslSystem "x86_64-linux" "work";
};
};
};
}