This repository has been archived by the owner on Jan 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
124 lines (104 loc) · 3.98 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
rec {
description = "NixOS configuration";
inputs = {
# Pinned
coggiebot.url = "github:skarlett/coggie-bot/d040dfe03f612120263386f1f1eda3116c4fb235";
coggiebot.inputs.nixpkgs.follows = "nixpkgs-unstable";
# Rolling
nixos-generators.url = "github:nix-community/nixos-generators";
nixos-generators.inputs.nixpkgs.follows = "nixpkgs";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
pkgs2211.url = "github:nixos/nixpkgs/nixos-22.11";
nur.url = "github:nix-community/NUR";
nix-alien.url = "github:thiagokokada/nix-alien";
nix-ld.url = "github:mic92/nix-ld/main";
agenix.url = "github:ryantm/agenix";
deploy.url = "github:serokell/deploy-rs";
utils.url = "github:numtide/flake-utils";
chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
gomod2nix.url = "github:nix-community/gomod2nix";
dns = {
url = "github:kirelagin/dns.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# devenv.url = "github:cachix/devenv";
parts.url = "github:hercules-ci/flake-parts";
# remove eventually
hm.url = "github:nix-community/home-manager/release-23.05";
vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
};
outputs = inputs@{parts, self, nixpkgs, ...}:
parts.lib.mkFlake { inherit inputs; } {
imports = [
parts.flakeModules.easyOverlay
# inputs.devenv.flakeModule
];
systems = [
"x86_64-linux"
"aarch64-linux"
];
perSystem = args@{ config, self', inputs', pkgs, system, ... }: {
overlayAttrs = config.packages;
# wait for resolve
# https://github.com/cachix/devenv/issues/760
# devenv.shells.default = import ./devenv ( args // { inherit self; });
packages.airsonic-advanced-war = pkgs.callPackage ./packages/airsonic-advanced.nix {};
packages.unallocatedspace-frontend = pkgs.callPackage ./packages/unallocatedspace.dev {
FQDN = "unallocatedspace.dev";
REDIRECT = "https://github.com/skarlett";
};
packages.pzupdate = pkgs.callPackage ./packages/pzserver/pzupdate.nix {
pzdir = "/srv/planetz";
};
packages.pzconfig =
let
conf-builder = src: name: pkgs.stdenv.mkDerivation {
inherit name src;
phases = "installPhase";
installPhase = ''
mkdir -p $out
cp -r $src $out
'';
};
in
conf-builder ./packages/pzserver/servertest "servertest";
packages.pzstart = pkgs.callPackage ./packages/pzserver/pzstart.nix {
inherit (config.packages) pzupdate pzconfig;
};
packages.ferret = pkgs.callPackage ./packages/ferret {};
packages.all = pkgs.buildEnv {
name = "flake packages";
paths = builtins.attrValues (builtins.removeAttrs config.packages ["all"]);
};
};
flake = {
lib.applyOverlay = {system, config}: o:
if (builtins.isFunction o) then
o (inputs // { inherit system config; })
else
o;
nixosModules = {
common = import ./modules/common.nix;
remote-access = import ./modules/accessible.nix;
keys = import ./modules/keys.nix;
luninet = import ./modules/peers.nix;
arl-scrape = import ./modules/arl-scrape.nix;
project-zomboid = import ./modules/project-zomboid.nix;
unallocatedspace = import ./modules/unallocatedspace.nix;
airsonic-advanced = import ./modules/airsonic-advanced.nix;
};
overlays = {
flagship-custom = import ./overlays/flagship.nix;
project-zomboid = import ./overlays/project-zomboid.nix;
airsonic-advanced = import ./overlays/airsonic-advanced.nix;
unallocatedspace = import ./overlays/unallocatedspace.nix;
};
nixosConfigurations = import ./machines inputs;
deploy.nodes = import ./deployments.nix {
inherit self;
inherit (inputs) deploy;
};
};
};
}