-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
137 lines (128 loc) · 4.22 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
136
137
{
description = "My personnal configuration";
inputs = {
sops-nix.url = "github:Mic92/sops-nix";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
nixos-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
my-dotfiles = {
url = "github:adfaure/dotfiles";
# url = "/home/adfaure/code/dotfiles";
# It is possible to pin the revision with:
# To be fully reproducible, I can pin my repos
# "github:/adfaure/dotfiles?rev=602790e25de91ae166c10b93735bbaea667f7a49";
flake = false;
};
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim-config = {
url = "github:adfaure/nixvim-config";
};
catppuccin.url = "github:catppuccin/nix/a48e70a31616cb63e4794fd3465bff1835cc4246";
};
outputs = inputs @ {
self,
nixpkgs,
nixos-unstable,
my-dotfiles,
home-manager,
catppuccin,
nixvim-config,
sops-nix,
}: let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [];
};
unstable = import nixos-unstable {
inherit system;
config.allowUnfree = true;
overlays = [];
};
in {
packages.${system} = rec {
# Programs
cgvg = pkgs.callPackage ./pkgs/cgvg/default.nix {};
myVscode = unstable.callPackage ./pkgs/vscode {};
simplematch = pkgs.callPackage ./pkgs/simplematch {};
ExifRead = pkgs.callPackage ./pkgs/exifread {};
organize = pkgs.callPackage ./pkgs/organize {inherit simplematch ExifRead;};
obsidian-nvim = pkgs.callPackage ./pkgs/obsidian-nvim {};
cgvg-rs = pkgs.callPackage ./pkgs/rgvg {};
nix = unstable.nix;
};
# Separated home-manager config for non-nixos machines.
# Activate with: home-manager --flake .#adfaure switch
homeConfigurations = let
home-module = {
nixpkgs.overlays = [self.overlays.default];
nixpkgs.config.allowUnfree = true;
home = rec {
username = "adfaure";
homeDirectory = "/home/${username}";
stateVersion = "20.09";
};
};
extraSpecialArgs = {
inherit my-dotfiles home-module unstable nixvim-config system;
};
in {
# Include programs that need X or wayland
graphical = home-manager.lib.homeManagerConfiguration {
inherit extraSpecialArgs pkgs;
modules = [
home-module
sops-nix.homeManagerModules.sops
catppuccin.homeManagerModules.catppuccin
./homes/graphical.nix
./homes/base.nix
];
};
# Can be use in VPS for instance without graphical installation
base = home-manager.lib.homeManagerConfiguration {
inherit extraSpecialArgs;
modules = [
home-module
sops-nix.homeManagerModules.sops
./homes/base.nix
];
};
wsl = home-manager.lib.homeManagerConfiguration {
inherit extraSpecialArgs;
pkgs = unstable;
modules = [
home-module
./homes/wsl.nix
];
};
};
# Overlay to inject my packages in the different modules
overlays.default = final: prev: {
cgvg = self.packages.${system}.cgvg;
myVscode = self.packages.${system}.myVscode;
organize = self.packages.${system}.organize;
nixFlakes = self.packages.${system}.nix;
obsidian-nvim = self.packages.${system}.obsidian-nvim;
cgvg-rs = self.packages.${system}.cgvg-rs;
};
nixosModules.overlay = {...}: {
nixpkgs.overlays = [self.overlays.default];
};
nixosConfigurations = {
gouttelette = import ./systems/goutelette.nix {inherit system inputs;};
# Simple VM so I don't need to reboot when I am experimenting
# # nix build .#'nixosConfigurations.vm.config.system.build.vm'
# # ./result/bin/run-nixos-vm
# user password: nixos
vm = import ./systems/vm.nix {inherit system inputs unstable;};
};
formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra;
checks.${system} = builtins.listToAttrs (map (name: {
name = name;
value = self.packages.${system}.${name};
}) (builtins.attrNames self.packages.${system}));
};
}