-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
110 lines (105 loc) · 3.09 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
# /etc/nixos/flake.nix
{
description = "flake for gustavo-Desktop";
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable";
};
nixpkgs-stable = {
url = "github:NixOS/nixpkgs/nixos-24.11";
};
hardware = {
url = "github:NixOS/nixos-hardware/master";
};
# home-manager for home management : )
home-manager = {
url = "github:nix-community/home-manager";
# The follows keyword in inputs is used for inheritance
# Here inputs.nixpkgs of home-manager is kept consistent with
# the inputs.nixpkgs of the current flake
# to avoid problems due to version mismatch
inputs.nixpkgs.follows = "nixpkgs";
};
flake-parts.url = "github:hercules-ci/flake-parts";
hyprland = {
url = "github:hyprwm/Hyprland";
};
hyprland-plugins = {
url = "github:hyprwm/hyprland-plugins";
inputs.hyprland.follows = "hyprland";
};
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
stylix = {
url = "github:danth/stylix";
};
# impermanence.url = "github:nix-community/impermanence";
sops-nix = {
url = "github:mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-gl = {
url = "github:nix-community/nixgl";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
home-manager,
...
} @ inputs: let
inherit (self) outputs;
systems = [
"x86_64-linux"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
nixOsConfig = ./nixos/configuration.nix;
hmConfig = ./home/home.nix;
nixvimLib = inputs.nixvim.lib.x86_64-linux;
nixvim' = inputs.nixvim.legacyPackages.x86_64-linux;
nixvimModule = {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
module = ./home/nixvim/config;
extraSpecialArgs = {
# Any extra args to nixvim module
};
};
nvim = nixvim'.makeNixvimWithModule nixvimModule;
in rec {
packages =
forAllSystems (system: (import ./pkgs nixpkgs.legacyPackages.${system})
// { inherit nvim; });
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
overlays = import ./overlays {inherit inputs;};
nixosModules = import ./modules/nixos;
homeManagerModules = import ./modules/home-manager;
nixosConfigurations = {
gustavo-Desktop = let
pkgs = import nixpkgs { inherit overlays; };
in
nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = {inherit inputs outputs home-manager hmConfig;}; # Extra params to configuration
modules = [
nixOsConfig
# make home-manager as a module of nixos
# so that its config will be deployed automatically
inputs.stylix.nixosModules.stylix
];
};
};
homeConfigurations = {
"gustavo@Gustavo-Desktop" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {inherit inputs outputs;};
modules = [
hmConfig
inputs.stylix.homeManagerModules.stylix
];
};
};
};
}