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,8 +12,7 @@ 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;

View file

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

View file

@ -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

View file

@ -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": {

View file

@ -1,9 +1,7 @@
{ 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:
rec {
dino = super.dino.overrideAttrs ( dino = super.dino.overrideAttrs (
{ patches ? [], ... }: { { patches ? [], ... }: {
patches = patches ++ [ patches = patches ++ [
@ -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

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.arc
users.hexchen users.hexchen
./system.nix ./system.nix
./base16.nix
./net.nix ./net.nix
./access.nix ./access.nix
./locale.nix ./locale.nix

View file

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

View file

@ -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"
];
} }

View file

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