-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
136 lines (119 loc) · 4.87 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
{
description = "Carlo Cuoghi (NerdHusky86) Config";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
hardware.url = "github:nixos/nixos-hardware";
impermanence.url = "github:nix-community/impermanence";
nur.url = "github:nix-community/NUR";
hyprpicker.url = "github:hyprwm/hyprpicker";
hypr-contrib.url = "github:hyprwm/contrib";
flake-parts.url = "github:hercules-ci/flake-parts";
sops-nix.url = "github:Mic92/sops-nix";
# nixpkgs-f2k.url = "github:fortuneteller2k/nixpkgs-f2k";
hyprland = {
url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-doom-emacs.url = "github:nix-community/nix-doom-emacs";
nix-colors.url = "github:misterio77/nix-colors";
};
outputs = { self, nixpkgs, home-manager, nix-colors, nix-doom-emacs, ... }@inputs:
let
inherit (self) outputs;
system = "x86_64-linux";
# pkgs = import nixpkgs {
# inherit system;
# config.allowUnfree = true;
# config.cudaSupport = true;
# };
pkgs = import nixpkgs {
inherit system;
overlays = [
self.overlays.default
];
};
forEachSystem = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ];
forEachPkgs = f: forEachSystem (sys: f nixpkgs.legacyPackages.${sys});
mkNixos = modules: nixpkgs.lib.nixosSystem {
inherit modules;
specialArgs = { inherit inputs outputs; };
};
mkHome = modules: pkgs: home-manager.lib.homeManagerConfiguration {
inherit modules pkgs;
extraSpecialArgs = { inherit inputs outputs; };
};
in
{
nix.settings = {
substituters = ["https://hyprland.cachix.org"];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
};
# Your custom packages
# Acessible through 'nix build', 'nix shell', etc
# packages = forEachPkgs (pkgs: (import ./pkgs { inherit pkgs; }) // {
# neovim = let
# homeCfg = mkHome [ ./home/misterio/generic.nix ] pkgs;
# in pkgs.writeShellScriptBin "nvim" ''
# ${homeCfg.config.programs.neovim.finalPackage}/bin/nvim \
# -u ${homeCfg.config.xdg.configFile."nvim/init.lua".source} \
# "$@"
# '';
# });
# Devshell for bootstrapping
# Acessible through 'nix develop' or 'nix-shell' (legacy)
# devShells = forEachPkgs (pkgs: import ./shell.nix { inherit pkgs; });
formatter = forEachPkgs (pkgs: pkgs.nixpkgs-fmt);
# Your custom packages and modifications, exported as overlays
overlays = import ./overlays /* { inherit outputs; }*/;
# overlays =
# # Apply each overlay found in the /overlays directory
# let path = ./overlays; in with builtins;
# map (n: import (path + ("/" + n)))
# (filter (n: match ".*\\.nix" n != null ||
# pathExists (path + ("/" + n + "/default.nix")))
# (attrNames (readDir path)));
# Reusable nixos modules you might want to export
# These are usually stuff you would upstream into nixpkgs
nixosModules = import ./modules/nixos;
# Reusable home-manager modules you might want to export
# These are usually stuff you would upstream into home-manager
homeManagerModules = import ./modules/home-manager;
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
# Desktops
phoenix = mkNixos [ ./hosts/phoenix ];
};
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
# Desktops
"carlo@phoenix" = mkHome [ ./home/carlo/phoenix.nix ] nixpkgs.legacyPackages."x86_64-linux";
};
# devShells = {
# cuda = with pkgs; mkShell {
# buildInputs = [
# cudaPackages.cudatoolkit
# # linuxPackages.nvidia_x11
# linuxKernel.packages.linux_xanmod_stable.nvidia_x11_stable_open
# # cudaPackages.cudnn
# procps gnumake util-linux m4 gperf unzip
# libGLU libGL
# xorg.libXi xorg.libXmu freeglut
# xorg.libXext xorg.libX11 xorg.libXv xorg.libXrandr zlib
# ncurses5 binutils
# ];
# shellHook = ''
# export LD_LIBRARY_PATH="${pkgs.linuxKernel.packages.linux_xanmod_stable.nvidia_x11_stable_open}/lib"
# export CUDA_PATH=${pkgs.cudaPackages.cudatoolkit}
# export EXTRA_LDFLAGS="-L/lib -L${pkgs.linuxKernel.packages.linux_xanmod_stable.nvidia_x11_stable_open}/lib"
# export EXTRA_CCFLAGS="-I/usr/include"
# '';
# };
# };
};
}