Some massive changes to make flakiness better
Renamed the @inputs to @top. This was a misguided attempt to make a
different change, but it's going to stick, now.
Began moving packages to their own folder rather than being intermingled
with overlays
Created a local overlay that just includes my personal packages
Cleaned up some dead code
Moved to just using the raw 'imports' instead of needing to explicitly
call out the `foo = import foo.nix {};` syntax
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
# Needs https://github.com/DeterminateSystems/flake-checker/pull/130
|
# Needs https://github.com/DeterminateSystems/flake-checker/pull/130
|
||||||
#flake-checker.enable = true;
|
#flake-checker.enable = true;
|
||||||
nixfmt-rfc-style.enable = true;
|
nixfmt-rfc-style.enable = true;
|
||||||
|
check-merge-conflicts.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-13
@@ -1,30 +1,31 @@
|
|||||||
{ inputs, overlays, ... }:
|
{ top, overlays, ... }:
|
||||||
let
|
let
|
||||||
mac =
|
mac =
|
||||||
{ system ? "aarch64-darwin"
|
{
|
||||||
, name
|
system ? "aarch64-darwin",
|
||||||
, channel ? inputs.nixunstable
|
name,
|
||||||
, hm ? inputs.hmunstable
|
channel ? top.nixunstable,
|
||||||
, extraMods ? [ ]
|
hm ? top.hmunstable,
|
||||||
|
extraMods ? [ ],
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
nixpkgs = import channel {
|
nixpkgs = import channel { inherit system overlays; };
|
||||||
inherit system overlays;
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
inputs.darwin.lib.darwinSystem {
|
top.darwin.lib.darwinSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = { inherit nixpkgs; };
|
specialArgs = {
|
||||||
|
inherit nixpkgs;
|
||||||
|
};
|
||||||
modules = [
|
modules = [
|
||||||
{
|
{
|
||||||
nixpkgs.overlays = overlays;
|
nixpkgs.overlays = overlays;
|
||||||
home-manager.extraSpecialArgs = {
|
home-manager.extraSpecialArgs = {
|
||||||
inherit inputs;
|
inherit top;
|
||||||
host = name;
|
host = name;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
hm.darwinModules.home-manager
|
hm.darwinModules.home-manager
|
||||||
inputs.self.modules.darwinModule
|
top.self.modules.darwinModule
|
||||||
./${name}
|
./${name}
|
||||||
] ++ extraMods;
|
] ++ extraMods;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -45,49 +45,72 @@
|
|||||||
zed.url = "github:zed-industries/zed/v0.156.x";
|
zed.url = "github:zed-industries/zed/v0.156.x";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, ... }@inputs:
|
outputs =
|
||||||
|
{ self, ... }@top:
|
||||||
let
|
let
|
||||||
local_overlay = import ./overlays;
|
local_overlay = import ./overlays;
|
||||||
|
packages_overlay = (
|
||||||
|
_: prev:
|
||||||
|
(import ./pkgs {
|
||||||
|
inherit self;
|
||||||
|
pkgs = prev;
|
||||||
|
}).packages
|
||||||
|
);
|
||||||
overlays = [
|
overlays = [
|
||||||
inputs.agenix.overlays.default
|
top.agenix.overlays.default
|
||||||
local_overlay
|
local_overlay
|
||||||
inputs.nurpkgs.overlay
|
packages_overlay
|
||||||
inputs.vsext.overlays.default
|
top.nurpkgs.overlay
|
||||||
(_: _: { zed-editor = inputs.zed.packages.x86_64-linux.default; })
|
top.vsext.overlays.default
|
||||||
|
(_: _: { zed-editor = top.zed.packages.x86_64-linux.default; })
|
||||||
];
|
];
|
||||||
|
|
||||||
in
|
in
|
||||||
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
top.flake-parts.lib.mkFlake { inputs = top; } {
|
||||||
systems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
|
systems = [
|
||||||
|
"aarch64-linux"
|
||||||
|
"x86_64-linux"
|
||||||
|
"aarch64-darwin"
|
||||||
|
];
|
||||||
|
|
||||||
flake = {
|
flake = {
|
||||||
nixosConfigurations = (import ./hosts { inherit inputs overlays; });
|
nixosConfigurations = (import ./hosts { inherit top overlays; });
|
||||||
|
|
||||||
darwinConfigurations = (import ./darwin { inherit inputs overlays; });
|
darwinConfigurations = (import ./darwin { inherit top overlays; });
|
||||||
|
|
||||||
homeConfigurations = (import ./home { inherit inputs overlays; });
|
homeConfigurations = (import ./home { inherit top overlays; });
|
||||||
|
|
||||||
overlays = {
|
overlays = {
|
||||||
default = local_overlay;
|
default = packages_overlay;
|
||||||
|
local = local_overlay;
|
||||||
};
|
};
|
||||||
|
|
||||||
modules = import ./modules;
|
modules = import ./modules;
|
||||||
};
|
};
|
||||||
|
|
||||||
perSystem = { pkgs, self', system, ... }: {
|
perSystem =
|
||||||
_module.args.pkgs = import inputs.nixstable {
|
{
|
||||||
inherit system overlays;
|
pkgs,
|
||||||
|
self',
|
||||||
|
system,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
_module.args = {
|
||||||
|
pkgs = import top.nixstable { inherit system overlays; };
|
||||||
|
};
|
||||||
|
|
||||||
|
imports = [ ./pkgs ];
|
||||||
|
|
||||||
|
checks = import ./checks.nix {
|
||||||
|
inherit system;
|
||||||
|
inherit (top) hooks;
|
||||||
|
};
|
||||||
|
|
||||||
|
devShells = import ./shells.nix {
|
||||||
|
inherit self' pkgs;
|
||||||
|
inherit (top) nixvimunstable;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
checks = import ./checks.nix { inherit system; inherit (inputs) hooks; };
|
|
||||||
|
|
||||||
devShells = import ./shells.nix { inherit self' pkgs; inherit (inputs) nixvimunstable; };
|
|
||||||
|
|
||||||
packages = rec {
|
|
||||||
default = iso;
|
|
||||||
iso = self.nixosConfigurations.iso.config.system.build.isoImage;
|
|
||||||
iso-beta = self.nixosConfigurations.iso-beta.config.system.build.isoImage;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-8
@@ -1,20 +1,22 @@
|
|||||||
{ inputs
|
{ top, overlays, ... }:
|
||||||
, overlays
|
|
||||||
, ...
|
|
||||||
}:
|
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
greghellings =
|
greghellings =
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
pkgs = (import inputs.nixunstable { inherit system overlays; config.allowUnfree = true; });
|
pkgs = (
|
||||||
|
import top.nixunstable {
|
||||||
|
inherit system overlays;
|
||||||
|
config.allowUnfree = true;
|
||||||
|
}
|
||||||
|
);
|
||||||
in
|
in
|
||||||
inputs.hmunstable.lib.homeManagerConfiguration {
|
top.hmunstable.lib.homeManagerConfiguration {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
modules = [ ./home.nix ];
|
modules = [ ./home.nix ];
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
inherit inputs;
|
inherit top;
|
||||||
nixvim = inputs.nixvimunstable;
|
nixvim = top.nixvimunstable;
|
||||||
gui = false;
|
gui = false;
|
||||||
gnome = false;
|
gnome = false;
|
||||||
host = "ivr";
|
host = "ivr";
|
||||||
|
|||||||
+39
-30
@@ -1,26 +1,35 @@
|
|||||||
{ pkgs, lib, inputs, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
top,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
nix23 = import inputs.nix23_05 {
|
nix23 = import top.nix23_05 {
|
||||||
inherit (pkgs.stdenv) system;
|
inherit (pkgs.stdenv) system;
|
||||||
overlays = [ inputs.self.overlays.default ];
|
overlays = [ top.self.overlays.default ];
|
||||||
};
|
};
|
||||||
py = nix23.python311.withPackages (p: with p; [
|
py = nix23.python311.withPackages (
|
||||||
django
|
p: with p; [
|
||||||
djangorestframework
|
django
|
||||||
django-rapyd-modernauth
|
djangorestframework
|
||||||
environs
|
django-rapyd-modernauth
|
||||||
mysqlclient
|
environs
|
||||||
pyyaml
|
mysqlclient
|
||||||
ruamel-yaml
|
pyyaml
|
||||||
tox
|
ruamel-yaml
|
||||||
]);
|
tox
|
||||||
|
]
|
||||||
|
);
|
||||||
x = pkgs.xonsh.override {
|
x = pkgs.xonsh.override {
|
||||||
extraPackages = (ps: [
|
extraPackages = (
|
||||||
pkgs.nur.repos.xonsh-xontribs.xonsh-direnv
|
ps: [
|
||||||
pkgs.nur.repos.xonsh-xontribs.xontrib-vox
|
pkgs.nur.repos.xonsh-xontribs.xonsh-direnv
|
||||||
ps.xonsh-apipenv
|
pkgs.nur.repos.xonsh-xontribs.xontrib-vox
|
||||||
pkgs.pipenv-ivr
|
ps.xonsh-apipenv
|
||||||
]);
|
pkgs.pipenv-ivr
|
||||||
|
]
|
||||||
|
);
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@@ -33,9 +42,7 @@ in
|
|||||||
|
|
||||||
nixpkgs.config = {
|
nixpkgs.config = {
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
permittedInsecurePackages = [
|
permittedInsecurePackages = [ "jitsi-meet-1.0.8043" ];
|
||||||
"jitsi-meet-1.0.8043"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
@@ -51,14 +58,16 @@ in
|
|||||||
robo3t
|
robo3t
|
||||||
x
|
x
|
||||||
];
|
];
|
||||||
file.".pip/pip.conf".text = (lib.strings.concatStringsSep "\n" [
|
file.".pip/pip.conf".text = (
|
||||||
"[global]"
|
lib.strings.concatStringsSep "\n" [
|
||||||
"retries = 1"
|
"[global]"
|
||||||
"index-url = https://pypi.python.org/simple"
|
"retries = 1"
|
||||||
"extra-index-url ="
|
"index-url = https://pypi.python.org/simple"
|
||||||
" https://pypi.ivrtechnology.com/simple/"
|
"extra-index-url ="
|
||||||
" https://pypidev.ivrtechnology.com/simple/"
|
" https://pypi.ivrtechnology.com/simple/"
|
||||||
]);
|
" https://pypidev.ivrtechnology.com/simple/"
|
||||||
|
]
|
||||||
|
);
|
||||||
username = "gregory.hellings";
|
username = "gregory.hellings";
|
||||||
homeDirectory = lib.mkForce "/home/gregory.hellings";
|
homeDirectory = lib.mkForce "/home/gregory.hellings";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
{ pkgs, config, lib, inputs, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
top,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.greg.vscodium;
|
cfg = config.greg.vscodium;
|
||||||
@@ -17,7 +23,7 @@ in
|
|||||||
programs.vscode = {
|
programs.vscode = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.vscodium;
|
package = pkgs.vscodium;
|
||||||
extensions = with inputs.vsext.extensions."${pkgs.stdenv.system}".vscode-marketplace; [
|
extensions = with top.vsext.extensions."${pkgs.stdenv.system}".vscode-marketplace; [
|
||||||
arrterian.nix-env-selector
|
arrterian.nix-env-selector
|
||||||
asvetliakov.vscode-neovim
|
asvetliakov.vscode-neovim
|
||||||
batisteo.vscode-django
|
batisteo.vscode-django
|
||||||
@@ -49,9 +55,7 @@ in
|
|||||||
"terminal.integrated.defaultProfile.linux" = "tmux";
|
"terminal.integrated.defaultProfile.linux" = "tmux";
|
||||||
"vscode-neovim.neovimInitVimPaths.darwin" = "~/.config/nvim/init.lua";
|
"vscode-neovim.neovimInitVimPaths.darwin" = "~/.config/nvim/init.lua";
|
||||||
"vscode-neovim.neovimInitVimPaths.linux" = "~/.config/nvim/init.lua";
|
"vscode-neovim.neovimInitVimPaths.linux" = "~/.config/nvim/init.lua";
|
||||||
"workbench.settings.applyToAllProfiles" = [
|
"workbench.settings.applyToAllProfiles" = [ "direnv.path.executable" ];
|
||||||
"direnv.path.executable"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
+35
-24
@@ -1,28 +1,33 @@
|
|||||||
{ inputs, overlays, ... }:
|
{ top, overlays, ... }:
|
||||||
let
|
let
|
||||||
wsl = args: (unstable (args // { extraMods = [ inputs.wsl.nixosModules.wsl ]; }));
|
wsl = args: (unstable (args // { extraMods = [ top.wsl.nixosModules.wsl ]; }));
|
||||||
unstable = args: (machine (args // {
|
unstable =
|
||||||
channel = inputs.nixunstable;
|
args:
|
||||||
hm = inputs.hmunstable;
|
(machine (
|
||||||
nixvim = inputs.nixvimunstable;
|
args
|
||||||
}));
|
// {
|
||||||
|
channel = top.nixunstable;
|
||||||
|
hm = top.hmunstable;
|
||||||
|
nixvim = top.nixvimunstable;
|
||||||
|
}
|
||||||
|
));
|
||||||
machine =
|
machine =
|
||||||
{ channel ? inputs.nixstable
|
{
|
||||||
, extraMods ? [ ]
|
channel ? top.nixstable,
|
||||||
, name
|
extraMods ? [ ],
|
||||||
, system ? "x86_64-linux"
|
name,
|
||||||
, hm ? inputs.hm
|
system ? "x86_64-linux",
|
||||||
, nixvim ? inputs.nixvimstable
|
hm ? top.hm,
|
||||||
,
|
nixvim ? top.nixvimstable,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
nixpkgs = import channel {
|
nixpkgs = import channel { inherit system; };
|
||||||
inherit system;
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
channel.lib.nixosSystem {
|
channel.lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = { inherit nixpkgs inputs overlays; };
|
specialArgs = {
|
||||||
|
inherit nixpkgs top overlays;
|
||||||
|
};
|
||||||
modules = [
|
modules = [
|
||||||
{
|
{
|
||||||
nixpkgs.overlays = overlays;
|
nixpkgs.overlays = overlays;
|
||||||
@@ -31,17 +36,17 @@ let
|
|||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
users.greg = import ../home/home.nix;
|
users.greg = import ../home/home.nix;
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
inherit inputs overlays nixvim;
|
inherit top overlays nixvim;
|
||||||
home = "/home/greg";
|
home = "/home/greg";
|
||||||
host = name;
|
host = name;
|
||||||
};
|
};
|
||||||
backupFileExtension = "bkp";
|
backupFileExtension = "bkp";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
inputs.agenix.nixosModules.default
|
top.agenix.nixosModules.default
|
||||||
hm.nixosModules.home-manager
|
hm.nixosModules.home-manager
|
||||||
inputs.self.modules.nixosModule
|
top.self.modules.nixosModule
|
||||||
inputs.nurpkgs.nixosModules.nur
|
top.nurpkgs.nixosModules.nur
|
||||||
./${name}
|
./${name}
|
||||||
] ++ extraMods;
|
] ++ extraMods;
|
||||||
};
|
};
|
||||||
@@ -58,7 +63,13 @@ in
|
|||||||
iso = machine { name = "iso"; };
|
iso = machine { name = "iso"; };
|
||||||
iso-beta = unstable { name = "iso"; };
|
iso-beta = unstable { name = "iso"; };
|
||||||
# nix build '.#nixosConfigurations.wsl.config.system.build.installer'
|
# nix build '.#nixosConfigurations.wsl.config.system.build.installer'
|
||||||
nixos = wsl { name = "wsl"; system = "aarch64-linux"; };
|
nixos = wsl {
|
||||||
|
name = "wsl";
|
||||||
|
system = "aarch64-linux";
|
||||||
|
};
|
||||||
# nix build '.#nixosConfigurations.wsl-aarch.config.system.build.installer'
|
# nix build '.#nixosConfigurations.wsl-aarch.config.system.build.installer'
|
||||||
nixos-arm = wsl { name = "wsl"; system = "aarch64-linux"; };
|
nixos-arm = wsl {
|
||||||
|
name = "wsl";
|
||||||
|
system = "aarch64-linux";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-12
@@ -2,7 +2,7 @@
|
|||||||
# your system. Help is available in the configuration.nix(5) man page
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
|
|
||||||
{ inputs, ... }:
|
{ top, ... }:
|
||||||
let
|
let
|
||||||
wanInterface = "enp2s0";
|
wanInterface = "enp2s0";
|
||||||
lanInterface = "enp1s0";
|
lanInterface = "enp1s0";
|
||||||
@@ -10,13 +10,12 @@ let
|
|||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = [
|
||||||
[
|
# Include the results of the hardware scan.
|
||||||
# Include the results of the hardware scan.
|
./hardware-configuration.nix
|
||||||
./hardware-configuration.nix
|
top.btc.nixosModules.default
|
||||||
inputs.btc.nixosModules.default
|
./bitcoin.nix
|
||||||
./bitcoin.nix
|
];
|
||||||
];
|
|
||||||
|
|
||||||
# Bootloader
|
# Bootloader
|
||||||
boot = {
|
boot = {
|
||||||
@@ -39,10 +38,12 @@ in
|
|||||||
"${wanInterface}".useDHCP = true;
|
"${wanInterface}".useDHCP = true;
|
||||||
"${lanInterface}" = {
|
"${lanInterface}" = {
|
||||||
useDHCP = false;
|
useDHCP = false;
|
||||||
ipv4.addresses = [{
|
ipv4.addresses = [
|
||||||
address = lanIpAddress;
|
{
|
||||||
prefixLength = 16;
|
address = lanIpAddress;
|
||||||
}];
|
prefixLength = 16;
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,92 +1,109 @@
|
|||||||
{ inputs, name, extra ? { }, packages ? [ ], overlays }:
|
{
|
||||||
|
top,
|
||||||
|
name,
|
||||||
|
extra ? { },
|
||||||
|
packages ? [ ],
|
||||||
|
overlays,
|
||||||
|
}:
|
||||||
|
|
||||||
({ config, pkgs, lib, ... }:
|
|
||||||
(
|
(
|
||||||
lib.attrsets.recursiveUpdate
|
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
(lib.attrsets.recursiveUpdate
|
||||||
|
{
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
inputs.agenix.nixosModules.default
|
top.agenix.nixosModules.default
|
||||||
inputs.self.modules.nixosModule
|
top.self.modules.nixosModule
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.overlays = overlays;
|
nixpkgs.overlays = overlays;
|
||||||
|
|
||||||
greg.tailscale.enable = true;
|
greg.tailscale.enable = true;
|
||||||
|
|
||||||
age = {
|
age = {
|
||||||
identityPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
identityPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
||||||
secrets.runner-reg = {
|
secrets.runner-reg = {
|
||||||
file = ../../secrets/gitlab/myself-${name}-runner-reg.age;
|
file = ../../secrets/gitlab/myself-${name}-runner-reg.age;
|
||||||
owner = "gitlab-runner";
|
owner = "gitlab-runner";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages =
|
||||||
curl
|
with pkgs;
|
||||||
gawk
|
[
|
||||||
git
|
curl
|
||||||
unzip
|
gawk
|
||||||
xorriso
|
git
|
||||||
wget
|
unzip
|
||||||
] ++ packages;
|
xorriso
|
||||||
|
wget
|
||||||
|
]
|
||||||
|
++ packages;
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
useHostResolvConf = pkgs.lib.mkForce false;
|
useHostResolvConf = pkgs.lib.mkForce false;
|
||||||
nameservers = [ "100.100.100.100" ];
|
nameservers = [ "100.100.100.100" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
users.users.gitlab-runner = {
|
users.users.gitlab-runner = {
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
group = "kvm";
|
group = "kvm";
|
||||||
extraGroups = [ "kvm" ];
|
extraGroups = [ "kvm" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
gitlab-runner = {
|
gitlab-runner = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings.concurrent = 5;
|
settings.concurrent = 5;
|
||||||
services = {
|
services = {
|
||||||
shell = {
|
shell = {
|
||||||
executor = "shell";
|
executor = "shell";
|
||||||
limit = 5;
|
limit = 5;
|
||||||
authenticationTokenConfigFile = config.age.secrets.runner-reg.path;
|
authenticationTokenConfigFile = config.age.secrets.runner-reg.path;
|
||||||
environmentVariables = {
|
environmentVariables = {
|
||||||
EFI_DIR = "${pkgs.OVMF.fd}/FV/";
|
EFI_DIR = "${pkgs.OVMF.fd}/FV/";
|
||||||
STORAGE_URL = "http://s3.thehellings.lan:9000";
|
STORAGE_URL = "http://s3.thehellings.lan:9000";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
resolved.enable = true;
|
||||||
};
|
};
|
||||||
resolved.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.gitlab-runner = {
|
systemd.services.gitlab-runner = {
|
||||||
wants = [
|
wants = [
|
||||||
"network-online.target"
|
"network-online.target"
|
||||||
"systemd-resolved.service"
|
"systemd-resolved.service"
|
||||||
];
|
];
|
||||||
after = [
|
after = [
|
||||||
"network.target"
|
"network.target"
|
||||||
"network-online.target"
|
"network-online.target"
|
||||||
"systemd-resolved.service"
|
"systemd-resolved.service"
|
||||||
];
|
];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
DevicePolicy = lib.mkForce "auto";
|
DevicePolicy = lib.mkForce "auto";
|
||||||
PrivateDevices = false;
|
PrivateDevices = false;
|
||||||
ProtectKernelModules = false;
|
ProtectKernelModules = false;
|
||||||
DevicesAllow = [ "/dev/kvm" "/dev/mem" ];
|
DevicesAllow = [
|
||||||
DynamicUser = lib.mkForce false;
|
"/dev/kvm"
|
||||||
User = "root";
|
"/dev/mem"
|
||||||
Group = "kvm";
|
];
|
||||||
|
DynamicUser = lib.mkForce false;
|
||||||
|
User = "root";
|
||||||
|
Group = "kvm";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
system.stateVersion = lib.mkForce "24.05";
|
system.stateVersion = lib.mkForce "24.05";
|
||||||
}
|
}
|
||||||
|
|
||||||
extra
|
extra
|
||||||
) # End of attrsets.recursiveUpdate
|
) # End of attrsets.recursiveUpdate
|
||||||
) # End of outter function wrapper
|
) # End of outter function wrapper
|
||||||
|
|||||||
+12
-14
@@ -1,16 +1,12 @@
|
|||||||
{ config, pkgs, lib, inputs, overlays, ... }:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
gitlabStateDir = "/var/lib/gitlab";
|
gitlabStateDir = "/var/lib/gitlab";
|
||||||
|
|
||||||
container = input: (lib.attrsets.recursiveUpdate
|
|
||||||
{
|
|
||||||
bindMounts."/etc/ssh".hostPath = "/etc/ssh"; # For agenix secrets
|
|
||||||
enableTun = true;
|
|
||||||
privateNetwork = true;
|
|
||||||
}
|
|
||||||
input);
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
networking = {
|
networking = {
|
||||||
@@ -28,12 +24,14 @@ in
|
|||||||
greg.proxies."git.thehellings.lan" = {
|
greg.proxies."git.thehellings.lan" = {
|
||||||
target = "http://192.168.200.2";
|
target = "http://192.168.200.2";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_set_header X-Forwarded-Proto https;
|
proxy_set_header X-Forwarded-Proto https;
|
||||||
proxy_set_header X-Forwarded-Ssl on;
|
proxy_set_header X-Forwarded-Ssl on;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
system.activationScripts.makeGitlabDir = lib.stringAfter [ "var" ] "mkdir -p ${gitlabStateDir} && touch ${gitlabStateDir}/touch";
|
system.activationScripts.makeGitlabDir = lib.stringAfter [
|
||||||
|
"var"
|
||||||
|
] "mkdir -p ${gitlabStateDir} && touch ${gitlabStateDir}/touch";
|
||||||
|
|
||||||
greg.containers.gitlab = {
|
greg.containers.gitlab = {
|
||||||
tailscale = true;
|
tailscale = true;
|
||||||
|
|||||||
+39
-30
@@ -1,11 +1,18 @@
|
|||||||
{ config, lib, inputs, overlays, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
top,
|
||||||
|
overlays,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.greg.containers;
|
cfg = config.greg.containers;
|
||||||
|
|
||||||
# Create a container with all our default settings
|
# Create a container with all our default settings
|
||||||
|
|
||||||
makeContainer = _: container:
|
makeContainer =
|
||||||
|
_: container:
|
||||||
let
|
let
|
||||||
agekey = "/etc/ssh/agenix_key";
|
agekey = "/etc/ssh/agenix_key";
|
||||||
in
|
in
|
||||||
@@ -18,32 +25,35 @@ let
|
|||||||
"${agekey}".hostPath = "/etc/ssh/ssh_host_ed25519_key"; # This is needed for agenix to
|
"${agekey}".hostPath = "/etc/ssh/ssh_host_ed25519_key"; # This is needed for agenix to
|
||||||
};
|
};
|
||||||
enableTun = container.tailscale;
|
enableTun = container.tailscale;
|
||||||
config = { ... }: {
|
config =
|
||||||
imports = [
|
{ ... }:
|
||||||
inputs.agenix.nixosModules.default
|
{
|
||||||
inputs.self.modules.nixosModule
|
imports = [
|
||||||
container.builder
|
top.agenix.nixosModules.default
|
||||||
];
|
top.self.modules.nixosModule
|
||||||
|
container.builder
|
||||||
|
];
|
||||||
|
|
||||||
nixpkgs.overlays = overlays;
|
nixpkgs.overlays = overlays;
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
firewall.enable = true;
|
firewall.enable = true;
|
||||||
useHostResolvConf = lib.mkForce false;
|
useHostResolvConf = lib.mkForce false;
|
||||||
|
};
|
||||||
|
|
||||||
|
age.identityPaths = [ agekey ];
|
||||||
|
|
||||||
|
greg.tailscale.enable = container.tailscale;
|
||||||
};
|
};
|
||||||
|
|
||||||
age.identityPaths = [ agekey ];
|
|
||||||
|
|
||||||
greg.tailscale.enable = container.tailscale;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.greg.containers = lib.mkOption {
|
options.greg.containers = lib.mkOption {
|
||||||
default = { };
|
default = { };
|
||||||
|
|
||||||
type = with lib.types; attrsOf (submodule (
|
type =
|
||||||
{
|
with lib.types;
|
||||||
|
attrsOf (submodule ({
|
||||||
options = {
|
options = {
|
||||||
tailscale = lib.mkOption {
|
tailscale = lib.mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
@@ -57,20 +67,19 @@ in
|
|||||||
builder = lib.mkOption {
|
builder = lib.mkOption {
|
||||||
default = { ... }: { };
|
default = { ... }: { };
|
||||||
description = ''
|
description = ''
|
||||||
This needs to be a function, like the one for
|
This needs to be a function, like the one for
|
||||||
a container's config. It will setup the core system above the
|
a container's config. It will setup the core system above the
|
||||||
defaults set in this module.
|
defaults set in this module.
|
||||||
'';
|
'';
|
||||||
example = ''
|
example = ''
|
||||||
{ pkgs, config, lib, ... } :
|
{ pkgs, config, lib, ... } :
|
||||||
{
|
{
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}));
|
||||||
));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|||||||
+31
-29
@@ -1,19 +1,20 @@
|
|||||||
final: prev:
|
final: prev:
|
||||||
|
|
||||||
let
|
let
|
||||||
myPackages = pypackages: with pypackages; [
|
myPackages =
|
||||||
black
|
pypackages: with pypackages; [
|
||||||
dateutil
|
black
|
||||||
ipython
|
dateutil
|
||||||
mypy
|
ipython
|
||||||
pylint
|
mypy
|
||||||
pyyaml
|
pylint
|
||||||
responses
|
pyyaml
|
||||||
ruamel-yaml
|
responses
|
||||||
tox
|
ruamel-yaml
|
||||||
typing-extensions
|
tox
|
||||||
virtualenv
|
typing-extensions
|
||||||
];
|
virtualenv
|
||||||
|
];
|
||||||
|
|
||||||
myPython = prev.python312.withPackages myPackages;
|
myPython = prev.python312.withPackages myPackages;
|
||||||
is2405 = prev.lib.versionAtLeast prev.lib.version "24";
|
is2405 = prev.lib.versionAtLeast prev.lib.version "24";
|
||||||
@@ -24,34 +25,34 @@ rec {
|
|||||||
|
|
||||||
## Testing adding python packages in the correct manner
|
## Testing adding python packages in the correct manner
|
||||||
pythonPackagesExtensions = (prev.pythonPackagesExtensions or [ ]) ++ [
|
pythonPackagesExtensions = (prev.pythonPackagesExtensions or [ ]) ++ [
|
||||||
(python-final: _:
|
(
|
||||||
let cp = python-final.callPackage; in {
|
python-final: _:
|
||||||
|
let
|
||||||
|
cp = python-final.callPackage;
|
||||||
|
in
|
||||||
|
{
|
||||||
django-rapyd-modernauth = cp ./django-rapyd-modernauth.nix { };
|
django-rapyd-modernauth = cp ./django-rapyd-modernauth.nix { };
|
||||||
graypy = cp ./graypy.nix { };
|
graypy = cp ./graypy.nix { };
|
||||||
itg-django-utils = cp ./itg-django-utils.nix { };
|
itg-django-utils = cp ./itg-django-utils.nix { };
|
||||||
xonsh-apipenv = cp ./xonsh-apipenv.nix { };
|
xonsh-apipenv = cp ./xonsh-apipenv.nix { };
|
||||||
})
|
}
|
||||||
|
)
|
||||||
];
|
];
|
||||||
|
|
||||||
# My own packages
|
# My own packages
|
||||||
aacs = prev.callPackage ./aacs.nix { };
|
aacs = prev.callPackage ./aacs.nix { };
|
||||||
create_ssl = prev.callPackage ./create_ssl.nix { };
|
create_ssl = prev.callPackage ./create_ssl.nix { };
|
||||||
enwiki-dump = prev.callPackage ./enwiki-dump.nix { };
|
enwiki-dump = prev.callPackage ./enwiki-dump.nix { };
|
||||||
hms = prev.callPackage ./hms {
|
|
||||||
pkgs = final.pkgs;
|
|
||||||
};
|
|
||||||
inject = prev.callPackage ./inject.nix { inherit (final) pkgs; };
|
inject = prev.callPackage ./inject.nix { inherit (final) pkgs; };
|
||||||
inject-darwin = prev.callPackage ./inject-darwin.nix { inherit (final) pkgs; };
|
inject-darwin = prev.callPackage ./inject-darwin.nix { inherit (final) pkgs; };
|
||||||
setup-ssh = prev.callPackage ./setup-ssh {
|
setup-ssh = prev.callPackage ./setup-ssh { pkgs = final.pkgs; };
|
||||||
pkgs = final.pkgs;
|
|
||||||
};
|
|
||||||
upgrade-pg-cluster = prev.callPackage ./upgrade-pg-cluster.nix { };
|
upgrade-pg-cluster = prev.callPackage ./upgrade-pg-cluster.nix { };
|
||||||
|
|
||||||
# Overrides of packages
|
# Overrides of packages
|
||||||
brew = prev.callPackage ./homebrew.nix { };
|
brew = prev.callPackage ./homebrew.nix { };
|
||||||
copier = (if is2405 then
|
copier = (
|
||||||
prev.copier.overridePythonAttrs
|
if is2405 then
|
||||||
(_: {
|
prev.copier.overridePythonAttrs (_: {
|
||||||
version = "9.1.0";
|
version = "9.1.0";
|
||||||
src = final.fetchFromGitHub {
|
src = final.fetchFromGitHub {
|
||||||
owner = "copier-org";
|
owner = "copier-org";
|
||||||
@@ -60,15 +61,16 @@ rec {
|
|||||||
hash = "sha256-x5r7Xv4lAOMkR+UIEeSY7LvbYMLpTWYuICYe9ygz1tA=";
|
hash = "sha256-x5r7Xv4lAOMkR+UIEeSY7LvbYMLpTWYuICYe9ygz1tA=";
|
||||||
postFetch = "rm $out/tests/demo/doc/ma*ana.txt";
|
postFetch = "rm $out/tests/demo/doc/ma*ana.txt";
|
||||||
};
|
};
|
||||||
}) else prev.copier);
|
})
|
||||||
|
else
|
||||||
|
prev.copier
|
||||||
|
);
|
||||||
libbluray-custom = prev.libbluray.override {
|
libbluray-custom = prev.libbluray.override {
|
||||||
withAACS = true;
|
withAACS = true;
|
||||||
withBDplus = true;
|
withBDplus = true;
|
||||||
};
|
};
|
||||||
template = prev.callPackage ./template.nix { };
|
template = prev.callPackage ./template.nix { };
|
||||||
handbrake = prev.handbrake.override {
|
handbrake = prev.handbrake.override { libbluray = libbluray-custom; };
|
||||||
libbluray = libbluray-custom;
|
|
||||||
};
|
|
||||||
libvirt-greg = prev.libvirt.overrideAttrs {
|
libvirt-greg = prev.libvirt.overrideAttrs {
|
||||||
postInstall = prev.libvirt.postInstall + "rm -r $out/lib/systemd/system/libvirtd.service";
|
postInstall = prev.libvirt.postInstall + "rm -r $out/lib/systemd/system/libvirtd.service";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
pkgs.writeShellScriptBin "hms" (builtins.readFile ./hms.sh)
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
{ nixunstable, flake-utils }:
|
|
||||||
|
|
||||||
flake-utils.lib.eachDefaultSystemMap (system:
|
|
||||||
let
|
|
||||||
pkgs = (import nixunstable { inherit system; });
|
|
||||||
in
|
|
||||||
{
|
|
||||||
hms = pkgs.callPackage ./hms.nix {
|
|
||||||
inherit pkgs;
|
|
||||||
};
|
|
||||||
|
|
||||||
brew = pkgs.callPackage ./homebrew.nix { };
|
|
||||||
|
|
||||||
django-rapyd-modernauth = pkgs.python3.pkgs.callPackage ./django-rapyd-modernauth.nix {
|
|
||||||
buildPythonPackage = pkgs.python3.pkgs.buildPythonPackage;
|
|
||||||
};
|
|
||||||
|
|
||||||
xonsh-direnv = pkgs.callPackage ./xonsh-direnv.nix {
|
|
||||||
buildPythonPackage = pkgs.python3.pkgs.buildPythonPackage;
|
|
||||||
fetchPypi = pkgs.python.pkgs.fetchPypi;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
)
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
c = pkgs.callPackage;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages = {
|
||||||
|
#default = iso;
|
||||||
|
#iso = top.self.nixosConfigurations.iso.config.system.build.isoImage;
|
||||||
|
#iso-beta = self.nixosConfigurations.iso-beta.config.system.build.isoImage;
|
||||||
|
hms = c ./hms { };
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{ writeShellScriptBin, ... }:
|
||||||
|
|
||||||
|
writeShellScriptBin "hms" (builtins.readFile ./hms.sh)
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
# vim: set ft=bash:
|
# vim: set ft=bash:
|
||||||
set -eo pipefail
|
|
||||||
# Build different targets with GUI or not
|
# Build different targets with GUI or not
|
||||||
|
|
||||||
# Build and switch
|
# Build and switch
|
||||||
Reference in New Issue
Block a user