Revamp to get lib overlays working. Base16 in console.

This commit is contained in:
kat witch 2021-07-04 23:45:04 +01:00
parent 61289c7253
commit 3903bc1766
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
11 changed files with 85 additions and 76 deletions

View file

@ -12,23 +12,22 @@ rec {
inherit (import ./lib/hosts.nix {
inherit pkgs sources profiles users;
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
getSources = sources: removeAttrs sources [ "__functor" "dorkfiles" ];
source2drv = value: if isDerivation value.outPath then value.outPath else value;
sources2drvs = sources: mapAttrs (_: source2drv) (getSources sources);
in recurseIntoAttrs rec {
local = sources2drvs sources;
hexchen = sources2drvs (import sources.hexchen {}).sources;
all = attrValues local ++ attrValues hexchen;
allStr = toString all;
};
sourceCache = with lib; let
getSources = sources: removeAttrs sources [ "__functor" "dorkfiles" ];
source2drv = value: if isDerivation value.outPath then value.outPath else value;
sources2drvs = sources: mapAttrs (_: source2drv) (getSources sources);
in recurseIntoAttrs rec {
local = sources2drvs sources;
hexchen = sources2drvs (import sources.hexchen {}).sources;
all = attrValues local ++ attrValues hexchen;
allStr = toString all;
};
deploy = import ./lib/deploy.nix {
inherit pkgs sources;

View file

@ -5,11 +5,14 @@
, profiles
, pkgsPath ? ../pkgs
, sources ? { }
, system ? builtins.currentSystem
}:
with pkgs.lib;
rec {
baseModules = import (pkgs.path + "/nixos/modules/module-list.nix");
hostNames = attrNames
(filterAttrs (name: type: type == "directory") (builtins.readDir hostsDir));
@ -18,23 +21,31 @@ rec {
_module.args = { inherit hosts targets; };
imports = [ ../nixos.nix ../modules/nixos ];
networking = { inherit hostName; };
nixpkgs.pkgs = import pkgsPath {
inherit (config.nixpkgs) config;
inherit sources;
};
nixpkgs.pkgs = pkgs;
};
hosts = listToAttrs (map
(hostName:
nameValuePair hostName (import (pkgs.path + "/nixos/lib/eval-config.nix") {
modules = [
nameValuePair hostName (evalModules {
modules = baseModules ++ [
(hostConfig hostName)
({ config, ... }: {
config._module.args.pkgs = pkgs;
config.nixpkgs.system = mkDefault system;
config.nixpkgs.initialSystem = system;
})
(if sources ? home-manager then
sources.home-manager + "/nixos"
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);

View file

@ -1,7 +1,7 @@
{ sources, lib, ... }:
{
imports = [
imports = with (import (sources.nixexprs + "/modules")).nixos; [ base16 base16-shared ] ++ [
./nftables
./fw-abstraction
./deploy-tf

View file

@ -53,10 +53,10 @@
"homepage": null,
"owner": "arcnmx",
"repo": "nixexprs",
"rev": "298f007bde9d248ec7ac714183c535cede714c90",
"sha256": "0pibsl0kfw603r49v6fmi1xbb0zzfabyka02hiiaw59lzz6h3iw4",
"rev": "d093ea9917e888b11e67933a63681d850cd38666",
"sha256": "03l50ps15qdgw6a9g18jw3rrjyyccwifwqzr7vk1xk477knl734m",
"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"
},
"nixos-mailserver": {
@ -87,10 +87,10 @@
"homepage": "https://nur.nix-community.org/",
"owner": "nix-community",
"repo": "NUR",
"rev": "12bc6855f2b7e0b6402d9f26fa6bf11ed63a274a",
"sha256": "00dhqz93kfmhb1qsqfrfsrlnw459czinqq8fqbfnh3jppjv4gskf",
"rev": "3a2ab4a91c7fc7f6e3519e3091cb589db3d063ca",
"sha256": "1y2vb526b7xxa2520kfldfkn2i8w5p3rywnnr29bghsd045smpz5",
"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"
},
"tf-nix": {

View file

@ -1,9 +1,7 @@
{ config ? { }, sources, system ? builtins.currentSystem, ... }@args:
{ sources, system ? builtins.currentSystem, ... }@args:
let
pkgs = import sources.nixpkgs { inherit config; };
overlay = self: super:
rec {
overlay = self: super: rec {
dino = super.dino.overrideAttrs (
{ patches ? [], ... }: {
patches = patches ++ [
@ -21,8 +19,6 @@ let
waybar = super.waybar.override { pulseSupport = true; };
notmuch = super.callPackage ./notmuch { inherit (super) notmuch; };
nur = import sources.nur {
nurpkgs = self;
pkgs = self;
@ -83,6 +79,16 @@ let
} // super.lib.optionalAttrs (builtins.pathExists ../trusted/pkgs)
(import ../trusted/pkgs { inherit super self; });
in
(pkgs.extend (import (sources.nixexprs + "/overlay.nix"))).extend overlay
pkgs = import sources.nixpkgs {
overlays = [
overlay
(import (sources.nixexprs + "/overlay.nix"))
];
config = {
allowUnfree = true;
permittedInsecurePackages = [
"ffmpeg-2.8.17"
];
};
};
in pkgs

View file

@ -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; };
})

View file

@ -0,0 +1,10 @@
{ config, ... }:
{
base16 = {
console = {
enable = true;
scheme = "rebecca.rebecca";
};
};
}

View file

@ -7,6 +7,7 @@
users.arc
users.hexchen
./system.nix
./base16.nix
./net.nix
./access.nix
./locale.nix

View file

@ -1,10 +1,13 @@
{ config, pkgs, ... }:
{
fonts.fonts = [
pkgs.tamzen
];
i18n.defaultLocale = "en_GB.UTF-8";
time.timeZone = "Europe/London";
console = {
font = "Lat2-Terminus16";
packages = [ pkgs.tamzen ];
keyMap = "uk";
};
}

View file

@ -4,15 +4,12 @@
boot.loader.grub.configurationLimit = 8;
boot.loader.systemd-boot.configurationLimit = 8;
nixpkgs.config = { allowUnfree = true; };
nix = {
nixPath = [
"nixpkgs=${sources.nixpkgs}"
"nur=${sources.nur}"
"arc=${sources.nixexprs}"
"ci=${sources.ci}"
"hexy=${sources.hexchen}"
];
binaryCaches = [ "https://arc.cachix.org" "https://kittywitch.cachix.org" ];
binaryCachePublicKeys =
@ -21,8 +18,4 @@
gc.options = lib.mkDefault "--delete-older-than 1w";
trustedUsers = [ "root" "@wheel" ];
};
nixpkgs.config.permittedInsecurePackages = [
"ffmpeg-2.8.17"
];
}

View file

@ -3,7 +3,7 @@
let
c1 = "\\e[22;34m";
c2 = "\\e[1;35m";
nixos_logo = [
nixos = [
" ${c1} ::::. ${c2}'::::: ::::' "
" ${c1} '::::: ${c2}':::::. ::::' "
" ${c1} ::::: ${c2}'::::.::::: "
@ -26,11 +26,21 @@ let
];
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 = {
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 "";
};
}