1
0
mirror of https://github.com/kmein/niveum synced 2026-03-18 02:51:08 +01:00

1 Commits

Author SHA1 Message Date
06c1be9e09 wip: flakes 2021-12-29 17:41:53 +01:00
27 changed files with 177 additions and 226 deletions

View File

@@ -38,7 +38,7 @@
dataDir = "/home/kfm/.config/syncthing"; dataDir = "/home/kfm/.config/syncthing";
cert = toString <system-secrets/syncthing/cert.pem>; cert = toString <system-secrets/syncthing/cert.pem>;
key = toString <system-secrets/syncthing/key.pem>; key = toString <system-secrets/syncthing/key.pem>;
inherit ((import ../lib).syncthing) devices; inherit ((import <niveum/lib>).syncthing) devices;
folders = folders =
let cloud-dir = "${config.users.users.me.home}/cloud"; let cloud-dir = "${config.users.users.me.home}/cloud";
in { in {

View File

@@ -1,7 +1,7 @@
{ pkgs, lib, config, options, ... }: { inputs, pkgs, lib, config, options, ... }:
let let
inherit (lib.strings) makeBinPath; inherit (lib.strings) makeBinPath;
inherit (import ../lib) localAddresses kieran; inherit (import <niveum/lib>) localAddresses kieran;
in { in {
imports = [ imports = [
../modules/system-dependent.nix ../modules/system-dependent.nix
@@ -11,7 +11,6 @@ in {
{ {
nix.nixPath = [ nix.nixPath = [
"/var/src" "/var/src"
"nixpkgs-overlays=${toString ../overlays}"
]; ];
} }
{ {
@@ -19,8 +18,6 @@ in {
config = { config = {
allowUnfree = true; allowUnfree = true;
packageOverrides = pkgs: { packageOverrides = pkgs: {
writeDashBin = pkgs.writers.writeDashBin;
writeDash = pkgs.writers.writeDash;
gfs-fonts = pkgs.callPackage <niveum/packages/gfs-fonts.nix> {}; gfs-fonts = pkgs.callPackage <niveum/packages/gfs-fonts.nix> {};
iolanguage = pkgs.callPackage <niveum/packages/iolanguage.nix> { }; iolanguage = pkgs.callPackage <niveum/packages/iolanguage.nix> { };
ix = pkgs.callPackage <niveum/packages/ix.nix> { }; ix = pkgs.callPackage <niveum/packages/ix.nix> { };
@@ -28,7 +25,7 @@ in {
}; };
overlays = [ overlays = [
(self: super: { (self: super: {
scripts = import ../packages/scripts { pkgs = super; lib = super.lib; }; scripts = import <niveum/packages/scripts> { pkgs = super; inherit lib; };
}) })
]; ];
}; };
@@ -223,13 +220,14 @@ in {
./nano.nix ./nano.nix
./neovim.nix ./neovim.nix
./neomutt.nix ./neomutt.nix
./nix.nix
./newsboat.nix ./newsboat.nix
./flameshot-once.nix ./flameshot-once.nix
./packages ./packages
# ./power-action.nix ./power-action.nix
./printing.nix ./printing.nix
./openweathermap.nix ./openweathermap.nix
# ./wallpaper.nix ./wallpaper.nix
./redshift.nix ./redshift.nix
./retiolum.nix ./retiolum.nix
./rofi.nix ./rofi.nix

View File

@@ -1,6 +1,6 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
inherit (import ../lib) defaultApplications colours theme; inherit (import <niveum/lib>) defaultApplications colours theme;
in { in {
home-manager.users.me.services.dunst = { home-manager.users.me.services.dunst = {
enable = true; enable = true;

View File

@@ -1,6 +1,6 @@
{ pkgs, config, lib, ... }: { pkgs, config, lib, ... }:
let let
inherit (import ../lib) kieran ignorePaths; inherit (import <niveum/lib>) kieran ignorePaths;
in in
{ {
environment.systemPackages = [ environment.systemPackages = [

View File

@@ -1,7 +1,7 @@
{ inputs, config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let let
inherit (import ../lib) defaultApplications colours; inherit (import <niveum/lib>) defaultApplications colours;
klem = import ../packages/scripts/klem.nix { klem = import <niveum/packages/scripts/klem.nix> {
inherit pkgs lib; inherit pkgs lib;
config.scripts = { config.scripts = {
"p.r" = pkgs.writers.writeDash "p.r" '' "p.r" = pkgs.writers.writeDash "p.r" ''
@@ -146,7 +146,7 @@ in {
}; };
}; };
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${ statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${
(pkgs.formats.toml {}).generate "i3status-rust.toml" (import ../lib/i3status-rust.nix { (pkgs.formats.toml {}).generate "i3status-rust.toml" (import <niveum/lib/i3status-rust.nix> {
inherit (config.niveum) batteryName wirelessInterface; inherit (config.niveum) batteryName wirelessInterface;
inherit colours; inherit colours;
inherit pkgs; inherit pkgs;

View File

@@ -1,5 +1,6 @@
{ pkgs, lib, ... }: let { pkgs, lib, ... }: let
swallow = command: "${pkgs.scripts.swallow}/bin/swallow ${command}"; swallow = command: "${pkgs.scripts.swallow}/bin/swallow ${command}";
nixpkgs-unstable = import <nixpkgs-unstable> { config.allowUnfree = true; };
in { in {
environment.shellAliases.smpv = swallow "mpv"; environment.shellAliases.smpv = swallow "mpv";
@@ -21,7 +22,7 @@ in {
"Alt+j" = "add video-pan-y -0.05"; "Alt+j" = "add video-pan-y -0.05";
}; };
scripts = [ scripts = [
pkgs.unstable.mpvScripts.youtube-quality nixpkgs-unstable.mpvScripts.youtube-quality
]; ];
}; };
}; };

View File

@@ -1,5 +1,6 @@
{ lib, pkgs, ... }: { lib, pkgs, ... }:
let let
autowifi = pkgs.writers.writePython3Bin "autowifi" { flakeIgnore = [ "E501" ]; } <stockholm/lass/5pkgs/autowifi/autowifi.py>;
profile = name: custom: lib.recursiveUpdate { profile = name: custom: lib.recursiveUpdate {
connection.id = name; connection.id = name;
connection.type = "wifi"; connection.type = "wifi";
@@ -82,5 +83,18 @@ in
users.users.me.extraGroups = [ "networkmanager" ]; users.users.me.extraGroups = [ "networkmanager" ];
systemd.services.autowifi = {
enable = false;
description = "Automatic wifi connector";
wantedBy = [ "multi-user.target" ];
path = [ pkgs.networkmanager ];
serviceConfig = {
Type = "simple";
Restart = "always";
RestartSec = "10s";
ExecStart = "${autowifi}/bin/autowifi";
};
};
environment.systemPackages = [ pkgs.speedtest-cli ]; environment.systemPackages = [ pkgs.speedtest-cli ];
} }

8
configs/nix.nix Normal file
View File

@@ -0,0 +1,8 @@
{ pkgs, ... }:
{
# enable `nix flake`
nix = {
package = pkgs.nixFlakes;
extraOptions = "experimental-features = nix-command flakes";
};
}

View File

@@ -3,8 +3,6 @@ let
suspend = pkgs.writers.writeDash "suspend" "${pkgs.systemd}/bin/systemctl suspend"; suspend = pkgs.writers.writeDash "suspend" "${pkgs.systemd}/bin/systemctl suspend";
in in
{ {
imports = [ <stockholm/krebs/3modules/power-action.nix> ];
krebs.power-action = { krebs.power-action = {
enable = true; enable = true;
plans.suspend = { plans.suspend = {

View File

@@ -1,6 +1,6 @@
{ pkgs, ... }: { pkgs, ... }:
let let
inherit (import ../lib) localAddresses; inherit (import <niveum/lib>) localAddresses;
hp-driver = pkgs.hplipWithPlugin; hp-driver = pkgs.hplipWithPlugin;
in { in {
services.printing = { services.printing = {

View File

@@ -1,6 +1,6 @@
{ pkgs, config, lib, ... }: { pkgs, config, lib, ... }:
let let
inherit (import ../lib) sshPort kieran; inherit (import <niveum/lib>) sshPort kieran;
in { in {
services.xserver.displayManager.sessionCommands = "${pkgs.openssh}/bin/ssh-add"; services.xserver.displayManager.sessionCommands = "${pkgs.openssh}/bin/ssh-add";

View File

@@ -1,6 +1,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
inherit (import ../lib) sshPort kieran; inherit (import <niveum/lib>) sshPort kieran;
in in
{ {
users.motd = "Welcome to ${config.networking.hostName}!"; users.motd = "Welcome to ${config.networking.hostName}!";

View File

@@ -1,6 +1,6 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
let let
theme = (import ../lib).theme pkgs; theme = (import <niveum/lib>).theme pkgs;
in { in {
environment.systemPackages = environment.systemPackages =
[ theme.gtk.package theme.icon.package theme.cursor.package ]; [ theme.gtk.package theme.icon.package theme.cursor.package ];

View File

@@ -1,7 +1,5 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }:
{ {
imports = [ <stockholm/krebs/3modules/fetchWallpaper.nix> ];
krebs.fetchWallpaper = { krebs.fetchWallpaper = {
enable = true; enable = true;
url = "http://prism.r/realwallpaper-krebs-stars-berlin.png"; url = "http://prism.r/realwallpaper-krebs-stars-berlin.png";

View File

@@ -1,40 +1,38 @@
{ pkgs, secrets, writeCommand, lib, nixosRebuildCommand ? "switch" }:
let let
sshPort = 22022; inherit (import ./lib/default.nix) sshPort;
# command that ensures we use flake.nix during switch krops = builtins.fetchGit { url = "https://cgit.krebsco.de/krops/"; };
command = targetPath: lib = import "${krops}/lib";
let pkgs = import "${krops}/pkgs" { };
commandLine = "TMPDIR=/tmp nixos-rebuild ${nixosRebuildCommand} --flake ${targetPath} -L --keep-going";
in
''
echo '${commandLine}'
nix-shell \
-E "with import <nixpkgs> {}; mkShell { buildInputs = [ git (nixos { nix.package = nixFlakes; }).nixos-rebuild ]; }" \
--run '${commandLine}'
'';
source = name: { source = name: lib.evalSource [{
niveum.file = toString ./.; niveum.file = toString ./.;
system-secrets.pass = { system-secrets.pass = {
dir = secrets; dir = toString ~/.password-store;
name = "systems/${name}"; name = "systems/${name}";
}; };
secrets.pass = { secrets.pass = {
dir = secrets; dir = toString ~/.password-store;
name = "shared"; name = "shared";
}; };
}; }];
deploy = {name, host}: writeCommand "/bin/system" { command = targetPath: ''
source = lib.evalSource [ (source name) ]; nix-shell -p git --run '
force = true; nixos-rebuild switch -v --show-trace --flake ${targetPath}/niveum || \
target = lib.mkTarget "root@${host}:${toString sshPort}/var/krops/niveum"; nixos-rebuild switch -v --flake ${targetPath}/niveum
inherit command; '
'';
createHost = name: target: pkgs.krops.writeCommand "deploy-${name}" {
source = source name;
inherit command target;
}; };
in { in rec {
zaatar = deploy { name = "zaatar"; host = "zaatar.r"; }; zaatar = createHost "zaatar" "root@zaatar.r:${toString sshPort}";
kabsa = deploy { name = "kabsa"; host = "kabsa.r"; }; kabsa = createHost "kabsa" "root@kabsa.r:${toString sshPort}";
manakish = deploy { name = "manakish"; host = "manakish.r"; }; makanek = createHost "kabsa" "root@makanek.r:${toString sshPort}";
makanek = deploy { name = "makanek"; host = "makanek.r"; }; manakish = createHost "kabsa" "root@manakish.r:${toString sshPort}";
all = pkgs.writeScript "deploy-all"
(lib.concatStringsSep "\n" [ zaatar kabsa makanek manakish ]);
} }

102
flake.lock generated
View File

@@ -1,20 +1,5 @@
{ {
"nodes": { "nodes": {
"flake-utils": {
"locked": {
"lastModified": 1638122382,
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -37,26 +22,19 @@
} }
}, },
"krops": { "krops": {
"inputs": { "flake": false,
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": { "locked": {
"lastModified": 1632420452, "lastModified": 1637419569,
"narHash": "sha256-ncK6vABW/Ku9XI0kqj1otarUfblryoQzSaOCnaZ0oSs=", "narHash": "sha256-0hxKZQIoByRDoPsfQq5qzFJioyWRX/fbpvMO2EYQ9lc=",
"owner": "Mic92", "ref": "master",
"repo": "krops", "rev": "13ae434b140035e7e2664bd5a8ef4c475413b2e0",
"rev": "0388970c568905fedcbf429e5745aacd4f7a6633", "revCount": 115,
"type": "github" "type": "git",
"url": "https://cgit.krebsco.de/krops"
}, },
"original": { "original": {
"owner": "Mic92", "type": "git",
"repo": "krops", "url": "https://cgit.krebsco.de/krops"
"type": "github"
} }
}, },
"nix-writers": { "nix-writers": {
@@ -91,18 +69,33 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-mozilla": {
"flake": false,
"locked": {
"lastModified": 1638887313,
"narHash": "sha256-FMYV6rVtvSIfthgC1sK1xugh3y7muoQcvduMdriz4ag=",
"owner": "mozilla",
"repo": "nixpkgs-mozilla",
"rev": "7c1e8b1dd6ed0043fb4ee0b12b815256b0b9de6f",
"type": "github"
},
"original": {
"owner": "mozilla",
"repo": "nixpkgs-mozilla",
"type": "github"
}
},
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1640540585, "lastModified": 1640725200,
"narHash": "sha256-cCmknKFjWgam9jq+58wSd0Z4REia8mjBP65kXcL3ki8=", "narHash": "sha256-yR8clhRTt1OBFojyBaNnNgD+om51nhuJ1OLqWqdY2Ow=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ac169ec6371f0d835542db654a65e0f2feb07838", "rev": "eaeea6e9337b93d2acb7c2aa27e3f4617408375a",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@@ -110,11 +103,11 @@
"retiolum": { "retiolum": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1640734423, "lastModified": 1640724425,
"narHash": "sha256-i/M1nyPnIEqV7K5dn0Q7V5mRtfzspH+AM6HbgPYGreI=", "narHash": "sha256-eGzvF96ZnrKqvQ7wnpa9OYsfBxUMV0Jdh3QGdZhbSek=",
"owner": "krebs", "owner": "krebs",
"repo": "retiolum", "repo": "retiolum",
"rev": "0e11e0119f330ea103a44e3502149ae50c1a299d", "rev": "5a32ea07d6ca5668ea06f14dffe94fb46d42c674",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -125,47 +118,30 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"home-manager": "home-manager", "home-manager": "home-manager",
"krops": "krops", "krops": "krops",
"nix-writers": "nix-writers", "nix-writers": "nix-writers",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-mozilla": "nixpkgs-mozilla",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"retiolum": "retiolum", "retiolum": "retiolum",
"secrets": "secrets",
"stockholm": "stockholm" "stockholm": "stockholm"
} }
}, },
"secrets": {
"flake": false,
"locked": {
"lastModified": 1640701876,
"narHash": "sha256-2vQ32k/z0Jh+Ade32mRA6tENetvWI6SNNrR5DJiBuWw=",
"ref": "master",
"rev": "120635422c7fb78c94e6a182fc384c98fb5cf4ce",
"revCount": 170,
"type": "git",
"url": "file:///home/kfm/projects/sphinx"
},
"original": {
"type": "git",
"url": "file:///home/kfm/projects/sphinx"
}
},
"stockholm": { "stockholm": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1640733142, "lastModified": 1640726454,
"narHash": "sha256-HzSEyYTGPoGAfgl+lZLb/DDUCQRoZ2iN7oTLhl+1KTQ=", "narHash": "sha256-twePnoB0NRhSM4zJOrUI/Zxzwx/u52ey6zA4YYGEvOc=",
"ref": "master", "ref": "master",
"rev": "687948cfe5154e03f93886dd27dc30c7910ba754", "rev": "2a47990f16935d909930c9dd1ed6f8f2982df638",
"revCount": 10222, "revCount": 10218,
"type": "git", "type": "git",
"url": "https://cgit.krebsco.de/stockholm" "url": "https://cgit.lassul.us/stockholm"
}, },
"original": { "original": {
"type": "git", "type": "git",
"url": "https://cgit.krebsco.de/stockholm" "url": "https://cgit.lassul.us/stockholm"
} }
} }
}, },

104
flake.nix
View File

@@ -1,98 +1,78 @@
# imported from https://github.com/pinpox/nixos/blob/bdc0d47111d57cd19512c83538a01f9f9a3fc847/flake.nix
# ref https://www.youtube.com/watch?v=mJbQ--iBc1U
{ {
description = "niveum systems"; description = "niveum systems";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/release-21.11"; nixpkgs.url = "github:nixos/nixpkgs/release-21.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs";
secrets = {
url = "/home/kfm/.password-store";
flake = false;
};
flake-utils = {
url = "github:numtide/flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-21.11"; url = "github:nix-community/home-manager/release-21.11";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# flake-utils.url = "github:numtide/flake-utils";
retiolum = { # flake-compat = {
url = "github:krebs/retiolum"; # url = "github:edolstra/flake-compat";
# flake = false;
# };
stockholm = {
url = "git+https://cgit.lassul.us/stockholm";
flake = false; flake = false;
}; };
nix-writers = { nix-writers = {
url = "git+https://cgit.krebsco.de/nix-writers"; url = "git+https://cgit.krebsco.de/nix-writers";
flake = false; flake = false;
}; };
stockholm = { krops = {
url = "git+https://cgit.krebsco.de/stockholm"; url = "git+https://cgit.krebsco.de/krops";
flake = false; flake = false;
}; };
krops = { retiolum = {
url = "github:Mic92/krops"; url = "github:krebs/retiolum";
inputs.nixpkgs.follows = "nixpkgs"; flake = false;
inputs.flake-utils.follows = "flake-utils"; };
nixpkgs-mozilla = {
url = "github:mozilla/nixpkgs-mozilla";
flake = false;
}; };
}; };
outputs = { self, nixpkgs, stockholm, secrets, nixpkgs-unstable, home-manager, retiolum, krops, nix-writers, ... }@inputs: outputs = { self, nixpkgs, nix-writers, home-manager, stockholm, ... }@inputs:
let let
system = "x86_64-linux"; nixosSystem = nixpkgs.lib.makeOverridable nixpkgs.lib.nixosSystem;
pkgs = nixpkgs.legacyPackages.${system};
writeCommand = krops.packages.${system}.writeCommand;
niveumSystem = configuration: nixpkgs.lib.nixosSystem {
inherit system;
modules = defaultModules ++ [ configuration ];
};
defaultModules = [ defaultModules = [
{ _module.args.inputs = inputs; } { _module.args.inputs = inputs; }
{
imports = [
home-manager.nixosModules.home-manager
"${stockholm}/krebs/3modules/power-action.nix"
"${stockholm}/krebs/3modules/fetchWallpaper.nix"
({ pkgs, ... }: { ({ pkgs, ... }: {
nix = { nix.nixPath = [ "nixpkgs=${pkgs.path}" ];
nixPath = [ "nixpkgs=${pkgs.path}" ];
package = pkgs.nixFlakes;
extraOptions = ''
experimental-features = nix-command flakes
'';
};
nixpkgs.overlays = [ nixpkgs.overlays = [
(_self: _super: {
unstable = nixpkgs-unstable.legacyPackages.${pkgs.system};
})
(import "${nix-writers}/pkgs") (import "${nix-writers}/pkgs")
# (import <stockholm/krebs/5pkgs>) (import "${stockholm}/krebs/5pkgs")
]; ];
}) })
home-manager.nixosModules.home-manager ({ pkgs, ... }: { # https://github.com/Mic92/dotfiles/blob/50826e8f247909557975f4f193ecbb4162b07310/nixos/modules/upgrade-diff.nix
{ system.activationScripts.diff = ''
${pkgs.nix}/bin/nix store diff-closures /run/current-system "$systemConfig"
'';
})
];
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
} }
]; ];
in in {
{
nixosConfigurations = { nixosConfigurations = {
kabsa = niveumSystem systems/kabsa/configuration.nix; kabsa = nixosSystem {
makanek = niveumSystem systems/makanek/configuration.nix; system = "x86_64-linux";
manakish = niveumSystem systems/manakish/configuration.nix; modules = defaultModules ++ [
zaatar = niveumSystem systems/zaatar/configuration.nix; systems/kabsa/configuration.nix
}; ];
apps.${system} = {
# nix run ".#deploy.kabsa"
deploy = pkgs.callPackage ./deploy.nix {
inherit secrets writeCommand;
inherit (krops) lib;
};
# nix run ".#test.kabsa"
test = pkgs.callPackage ./deploy.nix {
inherit secrets writeCommand;
inherit (krops) lib;
nixosRebuildCommand = "test";
}; };
}; };
}; };

View File

@@ -49,14 +49,6 @@ in [
logo = "http://lassul.us/art/portraits/selbstportrait.jpg"; logo = "http://lassul.us/art/portraits/selbstportrait.jpg";
desc = "Diminutive from lassus (weary, faint, tired). A programming human. Doing superior professional art."; desc = "Diminutive from lassus (weary, faint, tired). A programming human. Doing superior professional art.";
} }
{
stream = "https://cdn.c3voc.de/hls/abchillgleis/segment_Native.m3u8";
station = "RC3 Abchillgleis";
}
{
stream = "https://cdn.c3voc.de/hls/c3lounge/segment_Native.m3u8";
station = "RC3 Lounge";
}
{ {
stream = "https://radio.kmein.de/lyrik/listen.ogg"; stream = "https://radio.kmein.de/lyrik/listen.ogg";
station = "Lyrik"; station = "Lyrik";

View File

@@ -1,6 +1,7 @@
{ {
imports = [ imports = [
./constants.nix ./constants.nix
./dropbox.nix
./retiolum.nix ./retiolum.nix
]; ];
} }

View File

@@ -1,9 +1,8 @@
{ inputs, config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
with lib; with lib;
let let
netname = "retiolum"; netname = "retiolum";
cfg = config.networking.retiolum; cfg = config.networking.retiolum;
inherit (inputs) retiolum;
in { in {
options = { options = {
networking.retiolum.ipv4 = mkOption { networking.retiolum.ipv4 = mkOption {
@@ -32,8 +31,8 @@ in {
services.tinc.networks.${netname} = { services.tinc.networks.${netname} = {
name = cfg.nodename; name = cfg.nodename;
hosts = builtins.mapAttrs hosts = builtins.mapAttrs
(name: _: builtins.readFile "${retiolum}/hosts/${name}") (name: _: builtins.readFile "${<retiolum/hosts>}/${name}")
(builtins.readDir "${retiolum}/hosts"); (builtins.readDir <retiolum/hosts>);
rsaPrivateKeyFile = toString <system-secrets/retiolum.key>; rsaPrivateKeyFile = toString <system-secrets/retiolum.key>;
ed25519PrivateKeyFile = toString <system-secrets/retiolum.ed25519>; ed25519PrivateKeyFile = toString <system-secrets/retiolum.ed25519>;
extraConfig = '' extraConfig = ''
@@ -42,7 +41,7 @@ in {
''; '';
}; };
networking.extraHosts = builtins.readFile (toString "${retiolum}/etc.hosts"); networking.extraHosts = builtins.readFile (toString <retiolum/etc.hosts>);
environment.systemPackages = [ config.services.tinc.networks.${netname}.package ]; environment.systemPackages = [ config.services.tinc.networks.${netname}.package ];

View File

@@ -1,6 +0,0 @@
self: super:
with super.lib;
let
eval = import <nixpkgs/nixos/lib/eval-config.nix>;
paths = (eval {modules = [(import <nixos-config>)];}).config.nixpkgs.overlays;
in foldl' (flip extends) (_: super) paths self

View File

@@ -168,7 +168,7 @@ in rec {
| ${pkgs.man}/bin/man --local-file --pager="${pkgs.bat}/bin/bat -p" - | ${pkgs.man}/bin/man --local-file --pager="${pkgs.bat}/bin/bat -p" -
''; '';
playlist = import ./pls.nix { inherit pkgs; }; playlist = import ./pls.nix { inherit pkgs lib; };
mpv-tv = import ./mpv-tv.nix { inherit pkgs lib; }; mpv-tv = import ./mpv-tv.nix { inherit pkgs lib; };

View File

@@ -1,7 +1,5 @@
{ pkgs }: { lib, pkgs }:
let let
inherit (pkgs) lib;
playlistAPI = "https://radio.lassul.us"; playlistAPI = "https://radio.lassul.us";
sendIRC = pkgs.writers.writeDash "send-irc" '' sendIRC = pkgs.writers.writeDash "send-irc" ''

View File

@@ -1,7 +1,7 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let let
nixpkgs-unstable = import <nixpkgs-unstable> { config.allowUnfree = true; }; nixpkgs-unstable = import <nixpkgs-unstable> { config.allowUnfree = true; };
inherit (import ../../lib) retiolumAddresses; inherit (import <niveum/lib>) retiolumAddresses;
in in
{ {
imports = [ imports = [

View File

@@ -1,7 +1,3 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
inherit (import <niveum/lib>) retiolumAddresses; inherit (import <niveum/lib>) retiolumAddresses;

View File

@@ -5,21 +5,21 @@ in
{ {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
<home-manager/nixos> "${self.inputs.home-manager}/nixos"
<niveum/configs/wpa_supplicant.nix> ../configs/wpa_supplicant.nix
<niveum/configs/keyboard.nix> ../configs/keyboard.nix
<niveum/modules/retiolum.nix> ../modules/retiolum.nix
<niveum/configs/spacetime.nix> ../configs/spacetime.nix
<niveum/configs/nix.nix> ../configs/nix.nix
<niveum/configs/tuna.nix> ../configs/tuna.nix
<niveum/configs/sshd.nix> ../configs/sshd.nix
<niveum/configs/version.nix> ../configs/version.nix
<niveum/configs/gaslight.nix> ../configs/gaslight.nix
<niveum/configs/printing.nix> ../configs/printing.nix
<niveum/configs/traadfri.nix> ../configs/traadfri.nix
<niveum/configs/bvg.nix> ../configs/bvg.nix
<niveum/configs/moodle-dl/meinhark.nix> ../configs/moodle-dl/meinhark.nix
<niveum/configs/monitoring/push.nix> ../configs/monitoring/push.nix
{ {
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
} }
@@ -40,7 +40,7 @@ in
{ {
environment.systemPackages = environment.systemPackages =
let let
worldradio = pkgs.callPackage <niveum/packages/worldradio.nix> {}; worldradio = pkgs.callPackage ../packages/worldradio.nix {};
in [ in [
(pkgs.writers.writeDashBin "mpv" '' (pkgs.writers.writeDashBin "mpv" ''
${pkgs.mpv}/bin/mpv --no-video "$@" ${pkgs.mpv}/bin/mpv --no-video "$@"

View File

@@ -1,5 +1,5 @@
{ config, lib, pkgs, ... }: { { modulesPath, config, lib, pkgs, ... }: {
imports = [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix> ]; imports = [ "${modulesPath}/installer/scan/not-detected.nix" ];
boot.initrd.availableKernelModules = boot.initrd.availableKernelModules =
[ "ahci" "xhci_pci" "usb_storage" "sd_mod" "sdhci_acpi" "rtsx_usb_sdmmc" ]; [ "ahci" "xhci_pci" "usb_storage" "sd_mod" "sdhci_acpi" "rtsx_usb_sdmmc" ];