-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
83 lines (79 loc) · 2.45 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
{
description =
"The work of a arch lunatic *scratch that* chronic distro hopper";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
homeManager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.3.0";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-cosmic = {
url = "github:lilyinstarlight/nixos-cosmic";
inputs.nixpkgs.follows = "nixpkgs";
};
devenv.url = "github:cachix/devenv";
flake-utils.url = "github:numtide/flake-utils";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nur.url = "github:nix-community/NUR";
hardened-firefox = {
url = "github:arkenfox/user.js";
flake = false;
};
};
outputs = { self, nixpkgs, devenv, ... }@inputs:
let
lib = nixpkgs.lib;
currentSystem = builtins.getEnv "SYSTEM";
system = if currentSystem == "" then "x86_64-linux" else currentSystem;
currentUser = builtins.getEnv "USER";
user = if lib.elem currentUser [ "" "root" ] then "aditya" else currentUser;
pkgs = import nixpkgs { inherit system; };
overlays = [ ];
in {
# Develpment environment shells
devShells.${pkgs.system} = {
py = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [{
languages.python.enable = true;
languages.python.venv.enable = true;
packages = with pkgs;
[
(python3.withPackages (ps:
with ps; [
wheel
jupyter
numpy
pandas
scikit-learn
nltk
scipy
matplotlib
]))
];
}];
};
};
# NixOS Configuration
# Expects default config in hosts/{hostName}/configuration.nix
nixosConfigurations = lib.mapAttrs (hostName: system:
lib.nixosSystem {
inherit system;
modules = [ ./hosts/imports.nix ];
specialArgs = {
inherit inputs;
current = {
inherit hostName;
inherit user;
inherit overlays;
};
};
}) (lib.mapAttrs (path: type: system)
(lib.filterAttrs (path: type: type == "directory")
(builtins.readDir ./hosts)));
};
}