-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
87 lines (79 loc) · 2.07 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
{
description = "A flexible configuration for desktop and thinkpad.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.11";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
github-nvim-theme = {
url = "github:projekt0n/github-nvim-theme/v0.0.7";
flake = false;
};
awesome = {
url = "github:awesomeWM/awesome";
flake = false;
};
awesome-code-doc = {
url = "github:kosorin/awesome-code-doc";
flake = false;
};
};
outputs = inputs @ {
self,
nixpkgs,
...
}: let
system = "x86_64-linux";
# own functions
lib = nixpkgs.lib.extend (
final: prev: {
custom = import ./lib.nix nixpkgs.lib;
}
);
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
config.permittedInsecurePackages = [
"segger-jlink-qt4-794l"
];
config.segger-jlink.acceptLicense = true;
overlays = [self.overlays.default];
};
in {
packages."${system}" =
lib.custom.mapModules ./packages (p: pkgs.callPackage p {});
# package overlays
overlays.default = import ./overlay.nix {inherit inputs system;};
nixosModules =
{nixosConfig = import ./.;}
// lib.custom.mapModulesRec ./modules import;
nixosConfigurations = let
mkHost = system: path:
lib.nixosSystem {
inherit system;
specialArgs = {inherit lib inputs system;};
modules = [
{
nixpkgs.pkgs = pkgs;
modules.device.name = lib.mkDefault (builtins.baseNameOf path);
}
./. # default.nix
(import path)
];
};
in
lib.custom.mapModules ./hosts (mkHost system);
devShells."${system}".default = pkgs.mkShell {
name = "nixos-config";
buildInputs = [
pkgs.git
pkgs.alejandra
pkgs.nix-zsh-completions
pkgs.nil
pkgs.luajit
];
};
};
}