mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
Revamp to get lib overlays working. Base16 in console.
This commit is contained in:
parent
61289c7253
commit
3903bc1766
11 changed files with 85 additions and 76 deletions
27
default.nix
27
default.nix
|
|
@ -12,23 +12,22 @@ rec {
|
||||||
inherit (import ./lib/hosts.nix {
|
inherit (import ./lib/hosts.nix {
|
||||||
inherit pkgs sources profiles users;
|
inherit pkgs sources profiles users;
|
||||||
inherit (deploy) target;
|
inherit (deploy) target;
|
||||||
})
|
}) hosts targets;
|
||||||
hosts targets;
|
|
||||||
|
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
|
|
||||||
runners = import ./runners.nix { inherit lib; inherit (deploy) target; };
|
runners = import ./runners.nix { inherit lib; inherit (deploy) target; };
|
||||||
|
|
||||||
sourceCache = with lib; let
|
sourceCache = with lib; let
|
||||||
getSources = sources: removeAttrs sources [ "__functor" "dorkfiles" ];
|
getSources = sources: removeAttrs sources [ "__functor" "dorkfiles" ];
|
||||||
source2drv = value: if isDerivation value.outPath then value.outPath else value;
|
source2drv = value: if isDerivation value.outPath then value.outPath else value;
|
||||||
sources2drvs = sources: mapAttrs (_: source2drv) (getSources sources);
|
sources2drvs = sources: mapAttrs (_: source2drv) (getSources sources);
|
||||||
in recurseIntoAttrs rec {
|
in recurseIntoAttrs rec {
|
||||||
local = sources2drvs sources;
|
local = sources2drvs sources;
|
||||||
hexchen = sources2drvs (import sources.hexchen {}).sources;
|
hexchen = sources2drvs (import sources.hexchen {}).sources;
|
||||||
all = attrValues local ++ attrValues hexchen;
|
all = attrValues local ++ attrValues hexchen;
|
||||||
allStr = toString all;
|
allStr = toString all;
|
||||||
};
|
};
|
||||||
|
|
||||||
deploy = import ./lib/deploy.nix {
|
deploy = import ./lib/deploy.nix {
|
||||||
inherit pkgs sources;
|
inherit pkgs sources;
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,14 @@
|
||||||
, profiles
|
, profiles
|
||||||
, pkgsPath ? ../pkgs
|
, pkgsPath ? ../pkgs
|
||||||
, sources ? { }
|
, sources ? { }
|
||||||
|
, system ? builtins.currentSystem
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with pkgs.lib;
|
with pkgs.lib;
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
|
baseModules = import (pkgs.path + "/nixos/modules/module-list.nix");
|
||||||
|
|
||||||
hostNames = attrNames
|
hostNames = attrNames
|
||||||
(filterAttrs (name: type: type == "directory") (builtins.readDir hostsDir));
|
(filterAttrs (name: type: type == "directory") (builtins.readDir hostsDir));
|
||||||
|
|
||||||
|
|
@ -18,23 +21,31 @@ rec {
|
||||||
_module.args = { inherit hosts targets; };
|
_module.args = { inherit hosts targets; };
|
||||||
imports = [ ../nixos.nix ../modules/nixos ];
|
imports = [ ../nixos.nix ../modules/nixos ];
|
||||||
networking = { inherit hostName; };
|
networking = { inherit hostName; };
|
||||||
nixpkgs.pkgs = import pkgsPath {
|
nixpkgs.pkgs = pkgs;
|
||||||
inherit (config.nixpkgs) config;
|
|
||||||
inherit sources;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
hosts = listToAttrs (map
|
hosts = listToAttrs (map
|
||||||
(hostName:
|
(hostName:
|
||||||
nameValuePair hostName (import (pkgs.path + "/nixos/lib/eval-config.nix") {
|
nameValuePair hostName (evalModules {
|
||||||
modules = [
|
modules = baseModules ++ [
|
||||||
(hostConfig hostName)
|
(hostConfig hostName)
|
||||||
|
({ config, ... }: {
|
||||||
|
config._module.args.pkgs = pkgs;
|
||||||
|
config.nixpkgs.system = mkDefault system;
|
||||||
|
config.nixpkgs.initialSystem = system;
|
||||||
|
})
|
||||||
(if sources ? home-manager then
|
(if sources ? home-manager then
|
||||||
sources.home-manager + "/nixos"
|
sources.home-manager + "/nixos"
|
||||||
else
|
else
|
||||||
{ })
|
{ })
|
||||||
];
|
];
|
||||||
specialArgs = { inherit sources target profiles hostName users; };
|
args = {
|
||||||
|
inherit baseModules modules;
|
||||||
|
};
|
||||||
|
specialArgs = {
|
||||||
|
modulesPath = builtins.toString pkgs.path + "/nixos/modules";
|
||||||
|
inherit sources target profiles hostName users;
|
||||||
|
};
|
||||||
}))
|
}))
|
||||||
hostNames);
|
hostNames);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{ sources, lib, ... }:
|
{ sources, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = with (import (sources.nixexprs + "/modules")).nixos; [ base16 base16-shared ] ++ [
|
||||||
./nftables
|
./nftables
|
||||||
./fw-abstraction
|
./fw-abstraction
|
||||||
./deploy-tf
|
./deploy-tf
|
||||||
|
|
|
||||||
|
|
@ -53,10 +53,10 @@
|
||||||
"homepage": null,
|
"homepage": null,
|
||||||
"owner": "arcnmx",
|
"owner": "arcnmx",
|
||||||
"repo": "nixexprs",
|
"repo": "nixexprs",
|
||||||
"rev": "298f007bde9d248ec7ac714183c535cede714c90",
|
"rev": "d093ea9917e888b11e67933a63681d850cd38666",
|
||||||
"sha256": "0pibsl0kfw603r49v6fmi1xbb0zzfabyka02hiiaw59lzz6h3iw4",
|
"sha256": "03l50ps15qdgw6a9g18jw3rrjyyccwifwqzr7vk1xk477knl734m",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/arcnmx/nixexprs/archive/298f007bde9d248ec7ac714183c535cede714c90.tar.gz",
|
"url": "https://github.com/arcnmx/nixexprs/archive/d093ea9917e888b11e67933a63681d850cd38666.tar.gz",
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||||
},
|
},
|
||||||
"nixos-mailserver": {
|
"nixos-mailserver": {
|
||||||
|
|
@ -87,10 +87,10 @@
|
||||||
"homepage": "https://nur.nix-community.org/",
|
"homepage": "https://nur.nix-community.org/",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NUR",
|
"repo": "NUR",
|
||||||
"rev": "12bc6855f2b7e0b6402d9f26fa6bf11ed63a274a",
|
"rev": "3a2ab4a91c7fc7f6e3519e3091cb589db3d063ca",
|
||||||
"sha256": "00dhqz93kfmhb1qsqfrfsrlnw459czinqq8fqbfnh3jppjv4gskf",
|
"sha256": "1y2vb526b7xxa2520kfldfkn2i8w5p3rywnnr29bghsd045smpz5",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/nix-community/NUR/archive/12bc6855f2b7e0b6402d9f26fa6bf11ed63a274a.tar.gz",
|
"url": "https://github.com/nix-community/NUR/archive/3a2ab4a91c7fc7f6e3519e3091cb589db3d063ca.tar.gz",
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||||
},
|
},
|
||||||
"tf-nix": {
|
"tf-nix": {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
{ config ? { }, sources, system ? builtins.currentSystem, ... }@args:
|
{ sources, system ? builtins.currentSystem, ... }@args:
|
||||||
|
|
||||||
let
|
let
|
||||||
pkgs = import sources.nixpkgs { inherit config; };
|
overlay = self: super: rec {
|
||||||
overlay = self: super:
|
dino = super.dino.overrideAttrs (
|
||||||
rec {
|
|
||||||
dino = super.dino.overrideAttrs (
|
|
||||||
{ patches ? [], ... }: {
|
{ patches ? [], ... }: {
|
||||||
patches = patches ++ [
|
patches = patches ++ [
|
||||||
./dino/0001-add-an-option-to-enable-omemo-by-default-in-new-conv.patch
|
./dino/0001-add-an-option-to-enable-omemo-by-default-in-new-conv.patch
|
||||||
|
|
@ -21,8 +19,6 @@ let
|
||||||
|
|
||||||
waybar = super.waybar.override { pulseSupport = true; };
|
waybar = super.waybar.override { pulseSupport = true; };
|
||||||
|
|
||||||
notmuch = super.callPackage ./notmuch { inherit (super) notmuch; };
|
|
||||||
|
|
||||||
nur = import sources.nur {
|
nur = import sources.nur {
|
||||||
nurpkgs = self;
|
nurpkgs = self;
|
||||||
pkgs = self;
|
pkgs = self;
|
||||||
|
|
@ -83,6 +79,16 @@ let
|
||||||
|
|
||||||
} // super.lib.optionalAttrs (builtins.pathExists ../trusted/pkgs)
|
} // super.lib.optionalAttrs (builtins.pathExists ../trusted/pkgs)
|
||||||
(import ../trusted/pkgs { inherit super self; });
|
(import ../trusted/pkgs { inherit super self; });
|
||||||
|
pkgs = import sources.nixpkgs {
|
||||||
in
|
overlays = [
|
||||||
(pkgs.extend (import (sources.nixexprs + "/overlay.nix"))).extend overlay
|
overlay
|
||||||
|
(import (sources.nixexprs + "/overlay.nix"))
|
||||||
|
];
|
||||||
|
config = {
|
||||||
|
allowUnfree = true;
|
||||||
|
permittedInsecurePackages = [
|
||||||
|
"ffmpeg-2.8.17"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in pkgs
|
||||||
|
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
{ lib, notmuch, coreutils }@args:
|
|
||||||
let
|
|
||||||
notmuch = args.notmuch.super or args.notmuch;
|
|
||||||
drv = notmuch.override { withEmacs = false; };
|
|
||||||
in
|
|
||||||
drv.overrideAttrs (old: {
|
|
||||||
doCheck = false;
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
${old.postInstall or ""}
|
|
||||||
make -C bindings/ruby exec_prefix=$out \
|
|
||||||
SHELL=$SHELL \
|
|
||||||
$makeFlags ''${makeFlagsArray+"''${makeFlagsArray[@]}"} \
|
|
||||||
$installFlags ''${installFlagsArray+"''${installFlagsArray[@]}"} \
|
|
||||||
install
|
|
||||||
mv $out/lib/ruby/vendor_ruby/* $out/lib/ruby/
|
|
||||||
rmdir $out/lib/ruby/vendor_ruby
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = old.meta or { } // {
|
|
||||||
broken = old.meta.broken or false || notmuch.stdenv.isDarwin;
|
|
||||||
};
|
|
||||||
passthru = old.passthru or { } // { super = notmuch; };
|
|
||||||
})
|
|
||||||
10
profiles/common/base16.nix
Normal file
10
profiles/common/base16.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
{ config, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
base16 = {
|
||||||
|
console = {
|
||||||
|
enable = true;
|
||||||
|
scheme = "rebecca.rebecca";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
users.arc
|
users.arc
|
||||||
users.hexchen
|
users.hexchen
|
||||||
./system.nix
|
./system.nix
|
||||||
|
./base16.nix
|
||||||
./net.nix
|
./net.nix
|
||||||
./access.nix
|
./access.nix
|
||||||
./locale.nix
|
./locale.nix
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,13 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
fonts.fonts = [
|
||||||
|
pkgs.tamzen
|
||||||
|
];
|
||||||
i18n.defaultLocale = "en_GB.UTF-8";
|
i18n.defaultLocale = "en_GB.UTF-8";
|
||||||
time.timeZone = "Europe/London";
|
time.timeZone = "Europe/London";
|
||||||
console = {
|
console = {
|
||||||
font = "Lat2-Terminus16";
|
packages = [ pkgs.tamzen ];
|
||||||
keyMap = "uk";
|
keyMap = "uk";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,15 +4,12 @@
|
||||||
boot.loader.grub.configurationLimit = 8;
|
boot.loader.grub.configurationLimit = 8;
|
||||||
boot.loader.systemd-boot.configurationLimit = 8;
|
boot.loader.systemd-boot.configurationLimit = 8;
|
||||||
|
|
||||||
nixpkgs.config = { allowUnfree = true; };
|
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
nixPath = [
|
nixPath = [
|
||||||
"nixpkgs=${sources.nixpkgs}"
|
"nixpkgs=${sources.nixpkgs}"
|
||||||
"nur=${sources.nur}"
|
"nur=${sources.nur}"
|
||||||
"arc=${sources.nixexprs}"
|
"arc=${sources.nixexprs}"
|
||||||
"ci=${sources.ci}"
|
"ci=${sources.ci}"
|
||||||
"hexy=${sources.hexchen}"
|
|
||||||
];
|
];
|
||||||
binaryCaches = [ "https://arc.cachix.org" "https://kittywitch.cachix.org" ];
|
binaryCaches = [ "https://arc.cachix.org" "https://kittywitch.cachix.org" ];
|
||||||
binaryCachePublicKeys =
|
binaryCachePublicKeys =
|
||||||
|
|
@ -21,8 +18,4 @@
|
||||||
gc.options = lib.mkDefault "--delete-older-than 1w";
|
gc.options = lib.mkDefault "--delete-older-than 1w";
|
||||||
trustedUsers = [ "root" "@wheel" ];
|
trustedUsers = [ "root" "@wheel" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs.config.permittedInsecurePackages = [
|
|
||||||
"ffmpeg-2.8.17"
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
let
|
let
|
||||||
c1 = "\\e[22;34m";
|
c1 = "\\e[22;34m";
|
||||||
c2 = "\\e[1;35m";
|
c2 = "\\e[1;35m";
|
||||||
nixos_logo = [
|
nixos = [
|
||||||
" ${c1} ::::. ${c2}'::::: ::::' "
|
" ${c1} ::::. ${c2}'::::: ::::' "
|
||||||
" ${c1} '::::: ${c2}':::::. ::::' "
|
" ${c1} '::::: ${c2}':::::. ::::' "
|
||||||
" ${c1} ::::: ${c2}'::::.::::: "
|
" ${c1} ::::: ${c2}'::::.::::: "
|
||||||
|
|
@ -26,11 +26,21 @@ let
|
||||||
];
|
];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
console = {
|
||||||
|
font = "Tamzen7x14";
|
||||||
|
earlySetup = true;
|
||||||
|
getty = {
|
||||||
|
greetingPrefix =
|
||||||
|
''\e[H\e[2J'' + # topleft
|
||||||
|
''\e[9;10]''; # setterm blank/powersave = 10 minutes
|
||||||
|
greeting =
|
||||||
|
"\n" +
|
||||||
|
lib.concatStringsSep "\n" nixos +
|
||||||
|
"\n\n" +
|
||||||
|
''\e[1;32m>>> NixOS ${config.system.nixos.label} (Linux \r) - \l\e[0m'';
|
||||||
|
};
|
||||||
|
};
|
||||||
services.getty = {
|
services.getty = {
|
||||||
greetingLine = ''
|
|
||||||
\e[H\e[2J
|
|
||||||
\e[9;10]'' + lib.concatStringsSep "\n" nixos_logo + "\n\n"
|
|
||||||
+ "\\e[1;32m>>> NixOS ${config.system.nixos.label} (Linux \\r) - \\l\\e[0m";
|
|
||||||
helpLine = lib.mkForce "";
|
helpLine = lib.mkForce "";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue