-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
118 lines (105 loc) · 3.49 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
{
description = "Home Manager configuration of arifinoid";
inputs = {
nix.url = "github:nixos/nix";
nix.inputs.nixpkgs.follows = "nixpkgs";
## -- nixpkgs
nixpkgs-master.url = "github:NixOS/nixpkgs/master";
nixpkgs-stable.url = "github:NixOS/nixpkgs/release-22.11";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixpkgs.follows = "nixpkgs-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
utils.url = "github:numtide/flake-utils";
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
# secret management
sops = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-stable.follows = "nixpkgs-stable";
};
};
outputs =
inputs@{ self
, nixpkgs
, nixpkgs-unstable
, home-manager
, nixvim
, utils
, sops
, ...
}:
utils.lib.eachDefaultSystem (system:
let
config = { allowUnfree = true; };
pkgs = import nixpkgs {
inherit system;
config = config;
};
defaultNixpkgs = { inherit config; };
overlay-unstable = final: prev: {
unstable = inputs.nixpkgs.legacyPackages.${system};
};
in
{
nixpkgs.overlays = [ overlay-unstable ];
nixpkgs.config = { allowUnfree = true; };
homeConfigurations = {
nixvimUser = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules =
[ nixvim.homeManagerModules.nixvim ./home/nixvim/default.nix ];
};
arifinoid = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
sops.homeManagerModules.sops
({ pkgs, ... }:
let
nixConfigDirectory = "~/.config/nixpkgs";
username = "arifinoid";
homeDirectory = "/${
if pkgs.stdenv.isDarwin then "Users" else "home"
}/${username}";
in
{
home = {
stateVersion = "23.11";
username = username;
homeDirectory = homeDirectory;
shellAliases = {
flakeup =
# example flakeup nixpkgs-unstable
"nix flake lock ${nixConfigDirectory} --update-input";
nxb =
"nix build ${nixConfigDirectory}/#homeConfigurations.${system}.${username}.activationPackage -o ${nixConfigDirectory}/result ";
nxa =
"${nixConfigDirectory}/result/activate switch --flake ${nixConfigDirectory}/#homeConfigurations.${system}.${username}";
};
};
fonts.fontconfig.enable = true;
home.sessionVariables = {
LIBGL_ALWAYS_SOFTWARE = "1";
LIBGL_DRIVERS_PATH = "/usr/lib/x86_64-linux-gnu/dri";
MESA_LOADER_DRIVER_OVERRIDE = "iris";
};
})
./home/git.nix
./home/nvim.nix
./home/packages.nix
./home/shells.nix
./home/tmux.nix
];
};
};
legacyPackages =
import inputs.nixpkgs (defaultNixpkgs // { inherit system; });
devShells =
import ./devShells.nix { pkgs = self.legacyPackages.${system}; };
});
}