-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
135 lines (113 loc) · 3.57 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
126
127
128
129
130
131
132
133
134
135
{
description = "Your new nix config";
inputs = {
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
#nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.11";
nixpkgs-f89c670.url = "github:nixos/nixpkgs/f89c670a01ba9b5e2c29c2f692fd654dfab686b5";
# Home manager
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
hardware.url = "github:nixos/nixos-hardware";
geany-themes = {
url = "github:geany/geany-themes";
flake = false;
};
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
# TODO: Transfert everything relathing to cuda to their own flake
cuda_find_in_files4 = {
url = "github:CudaText-addons/cuda_find_in_files4";
flake = false;
};
cuda_differ = {
url = "github:CudaText-addons/cuda_differ";
flake = false;
};
cuda_fmt = {
url = "github:CudaText-addons/cuda_fmt";
flake = false;
};
cuda_fmt_js = {
url = "github:CudaText-addons/cuda_fmt_js";
flake = false;
};
# Does not work because of https://github.com/NixOS/nix/issues/7083
#cudaTheme_dracula = {
# url = "file+https://sourceforge.net/projects/cudatext/files/addons/themes/theme.Dracula.zip";
# flake = false;
#};
cudaTheme_darcula = {
url = "github:CudaText-addons/cudatext-theme-darcula";
flake = false;
};
cudatext-lexers = {
url = "github:Alexey-T/CudaText-lexers";
flake = false;
};
# Shameless plug: looking for a way to nixify your themes and make
# everything match nicely? Try nix-colors!
# nix-colors.url = "github:misterio77/nix-colors";
};
outputs = {
self,
nixpkgs,
nixpkgs-f89c670,
home-manager,
...
} @ inputs: let
inherit (self) outputs;
# Supported systems for your flake packages, shell, etc.
systems = [
"x86_64-linux"
];
# This is a function that generates an attribute by calling a function you
# pass to it, with each system as an argument
forAllSystems = nixpkgs.lib.genAttrs systems;
makeHostnameOption = hostname: {lib, ...}: {
options = {
hostname = lib.mkOption {
type = lib.types.str;
default = hostname;
};
};
};
makeNixosSystem = hostname: {
"${hostname}" = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs;
pkgs-f89c670 = import nixpkgs-f89c670 {
system = "x86_64-linux";
};
};
# > Our main nixos configuration file <
modules = [
(makeHostnameOption hostname)
./hosts/${hostname}
];
};
};
in
{
nixosModules = import ./modules/nixos;
homeManagerModules = import ./modules/home-manager;
# Your custom packages
# Accessible through 'nix build', 'nix shell', etc
packages = forAllSystems (system: import ./pkgs {pkgs = nixpkgs.legacyPackages.${system};});
overlays = import ./overlays { inherit inputs outputs; };
lib = import ./lib { inherit (nixpkgs) lib; };
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {}
// makeNixosSystem "asus-laptop-TUF517ZR";
};
}