mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
Compare commits
1 Commits
84f1a2688f
...
flakes-2
| Author | SHA1 | Date | |
|---|---|---|---|
| 248ebea28e |
@@ -1,12 +1,4 @@
|
||||
{ config, lib, pkgs, ... }: {
|
||||
imports = [
|
||||
<niveum/modules/dropbox.nix>
|
||||
];
|
||||
|
||||
niveum = {
|
||||
dropbox.enable = false;
|
||||
};
|
||||
|
||||
system.activationScripts.home-symlinks = ''
|
||||
ln -sfn ${config.users.users.me.home}/cloud/syncthing/common/mahlzeit ${config.users.users.me.home}/mahlzeit
|
||||
ln -sfn ${config.users.users.me.home}/cloud/Seafile/Wiki ${config.users.users.me.home}/notes
|
||||
@@ -46,7 +38,7 @@
|
||||
dataDir = "/home/kfm/.config/syncthing";
|
||||
cert = toString <system-secrets/syncthing/cert.pem>;
|
||||
key = toString <system-secrets/syncthing/key.pem>;
|
||||
inherit ((import <niveum/lib>).syncthing) devices;
|
||||
inherit ((import ../lib).syncthing) devices;
|
||||
folders =
|
||||
let cloud-dir = "${config.users.users.me.home}/cloud";
|
||||
in {
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
{ pkgs, lib, config, options, ... }:
|
||||
let
|
||||
inherit (lib.strings) makeBinPath;
|
||||
inherit (import <niveum/lib>) localAddresses kieran;
|
||||
inherit (import ../lib) localAddresses kieran;
|
||||
in {
|
||||
imports = [
|
||||
<home-manager/nixos>
|
||||
<niveum/modules/system-dependent.nix>
|
||||
../modules/system-dependent.nix
|
||||
{
|
||||
boot.supportedFilesystems = [ "ntfs" ];
|
||||
}
|
||||
@@ -28,10 +27,8 @@ in {
|
||||
};
|
||||
};
|
||||
overlays = [
|
||||
(import <nix-writers/pkgs>)
|
||||
(import <stockholm/krebs/5pkgs>)
|
||||
(self: super: {
|
||||
scripts = import <niveum/packages/scripts> { pkgs = super; lib = super.lib; };
|
||||
scripts = import ../packages/scripts { pkgs = super; lib = super.lib; };
|
||||
})
|
||||
];
|
||||
};
|
||||
@@ -203,13 +200,11 @@ in {
|
||||
./ccc.nix
|
||||
# ./kleiter.nix
|
||||
./khal.nix
|
||||
./engiadina.nix
|
||||
./chromium.nix
|
||||
./cloud.nix
|
||||
./copyq.nix
|
||||
./compton.nix
|
||||
./direnv.nix
|
||||
./distrobump.nix
|
||||
./docker.nix
|
||||
./dunst.nix
|
||||
./flix.nix
|
||||
@@ -228,14 +223,13 @@ in {
|
||||
./nano.nix
|
||||
./neovim.nix
|
||||
./neomutt.nix
|
||||
./nix.nix
|
||||
./newsboat.nix
|
||||
./flameshot-once.nix
|
||||
./packages
|
||||
./power-action.nix
|
||||
# ./power-action.nix
|
||||
./printing.nix
|
||||
./openweathermap.nix
|
||||
./wallpaper.nix
|
||||
# ./wallpaper.nix
|
||||
./redshift.nix
|
||||
./retiolum.nix
|
||||
./rofi.nix
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
{ lib, config, pkgs, ... }: {
|
||||
imports = [
|
||||
(import <stockholm/makefu/3modules/bump-distrowatch.nix> {
|
||||
inherit lib config;
|
||||
pkgs = pkgs // { writeDash = pkgs.writers.writeDash; };
|
||||
})
|
||||
];
|
||||
|
||||
makefu.distrobump.enable = false;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
inherit (import <niveum/lib>) defaultApplications colours theme;
|
||||
inherit (import ../lib) defaultApplications colours theme;
|
||||
in {
|
||||
home-manager.users.me.services.dunst = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
inherit (import <niveum/lib>) tmpfilesConfig;
|
||||
cdnRoot = "/var/lib/engiadina";
|
||||
in
|
||||
{
|
||||
imports = [ <stockholm/krebs/3modules/permown.nix> ];
|
||||
|
||||
krebs.permown.${cdnRoot} = {
|
||||
owner = config.users.users.me.name;
|
||||
group = "users";
|
||||
umask = "0002";
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts.default = {
|
||||
root = cdnRoot;
|
||||
listen = [{
|
||||
addr = "0.0.0.0";
|
||||
port = 3333;
|
||||
}];
|
||||
};
|
||||
};
|
||||
|
||||
environment.shellAliases = {
|
||||
engiadina-watch = "${pkgs.findutils}/bin/find extra-src src | ${pkgs.entr}/bin/entr -s 'build-component && ${pkgs.rsync}/bin/rsync -avu dist/*.js ${cdnRoot}/'";
|
||||
engiadina-edit = "$EDITOR ${cdnRoot}/index.html";
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
let
|
||||
inherit (import <niveum/lib>) kieran ignorePaths;
|
||||
inherit (import ../lib) kieran ignorePaths;
|
||||
in
|
||||
{
|
||||
environment.systemPackages = [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ config, pkgs, ... }: {
|
||||
imports = [ <niveum/modules/hledger.nix> ];
|
||||
imports = [ ../modules/hledger.nix ];
|
||||
|
||||
niveum.hledger = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{ inputs, config, pkgs, lib, ... }:
|
||||
let
|
||||
inherit (import <niveum/lib>) defaultApplications colours;
|
||||
klem = import <niveum/packages/scripts/klem.nix> {
|
||||
inherit (import ../lib) defaultApplications colours;
|
||||
klem = import ../packages/scripts/klem.nix {
|
||||
inherit pkgs lib;
|
||||
config.scripts = {
|
||||
"p.r" = pkgs.writers.writeDash "p.r" ''
|
||||
@@ -146,7 +146,7 @@ in {
|
||||
};
|
||||
};
|
||||
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${
|
||||
(pkgs.formats.toml {}).generate "i3status-rust.toml" (import <niveum/lib/i3status-rust.nix> {
|
||||
(pkgs.formats.toml {}).generate "i3status-rust.toml" (import ../lib/i3status-rust.nix {
|
||||
inherit (config.niveum) batteryName wirelessInterface;
|
||||
inherit colours;
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{ pkgs, lib, ... }: let
|
||||
swallow = command: "${pkgs.scripts.swallow}/bin/swallow ${command}";
|
||||
nixpkgs-unstable = import <nixpkgs-unstable> { config.allowUnfree = true; };
|
||||
in {
|
||||
environment.shellAliases.smpv = swallow "mpv";
|
||||
|
||||
@@ -22,7 +21,7 @@ in {
|
||||
"Alt+j" = "add video-pan-y -0.05";
|
||||
};
|
||||
scripts = [
|
||||
nixpkgs-unstable.mpvScripts.youtube-quality
|
||||
pkgs.unstable.mpvScripts.youtube-quality
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{ lib, pkgs, ... }:
|
||||
let
|
||||
autowifi = pkgs.writers.writePython3Bin "autowifi" { flakeIgnore = [ "E501" ]; } <stockholm/lass/5pkgs/autowifi/autowifi.py>;
|
||||
profile = name: custom: lib.recursiveUpdate {
|
||||
connection.id = name;
|
||||
connection.type = "wifi";
|
||||
@@ -39,7 +38,7 @@ let
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [ <niveum/modules/networkmanager-declarative.nix> ];
|
||||
imports = [ ../modules/networkmanager-declarative.nix ];
|
||||
|
||||
networking.networkmanager = {
|
||||
enable = true;
|
||||
@@ -83,18 +82,5 @@ in
|
||||
|
||||
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 ];
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
# enable `nix flake`
|
||||
nix = {
|
||||
package = pkgs.nixFlakes;
|
||||
extraOptions = "experimental-features = nix-command flakes";
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
inherit (import <niveum/lib>) localAddresses;
|
||||
inherit (import ../lib) localAddresses;
|
||||
hp-driver = pkgs.hplipWithPlugin;
|
||||
in {
|
||||
services.printing = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ config, pkgs, ... }: {
|
||||
imports = [
|
||||
<niveum/modules/retiolum.nix>
|
||||
../modules/retiolum.nix
|
||||
];
|
||||
|
||||
networking.hosts = { "42:0:ca48:f98f:63d7:31ce:922b:245d" = [ "go" ]; };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
let
|
||||
inherit (import <niveum/lib>) sshPort kieran;
|
||||
inherit (import ../lib) sshPort kieran;
|
||||
in {
|
||||
services.xserver.displayManager.sessionCommands = "${pkgs.openssh}/bin/ssh-add";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
inherit (import <niveum/lib>) sshPort kieran;
|
||||
inherit (import ../lib) sshPort kieran;
|
||||
in
|
||||
{
|
||||
users.motd = "Welcome to ${config.networking.hostName}!";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
theme = (import <niveum/lib>).theme pkgs;
|
||||
theme = (import ../lib).theme pkgs;
|
||||
in {
|
||||
environment.systemPackages =
|
||||
[ theme.gtk.package theme.icon.package theme.cursor.package ];
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
living-room-id = 131090;
|
||||
in
|
||||
{
|
||||
imports = [ <niveum/modules/traadfri.nix> ];
|
||||
imports = [ ../modules/traadfri.nix ];
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.writers.writeDashBin "traadfri-party" ''
|
||||
|
||||
96
deploy.nix
96
deploy.nix
@@ -1,68 +1,40 @@
|
||||
{ pkgs, secrets, writeCommand, lib, nixosRebuildCommand ? "switch" }:
|
||||
let
|
||||
inherit (import ./lib/default.nix) sshPort;
|
||||
sshPort = 22022;
|
||||
|
||||
gitFromJson = path:
|
||||
let object = importJson path;
|
||||
in {
|
||||
inherit (object) url;
|
||||
ref = object.rev;
|
||||
# command that ensures we use flake.nix during switch
|
||||
command = targetPath:
|
||||
let
|
||||
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: {
|
||||
niveum.file = toString ./.;
|
||||
system-secrets.pass = {
|
||||
dir = secrets;
|
||||
name = "systems/${name}";
|
||||
};
|
||||
secrets.pass = {
|
||||
dir = secrets;
|
||||
name = "shared";
|
||||
};
|
||||
krops = builtins.fetchGit (gitFromJson .versions/krops.json);
|
||||
lib = import "${krops}/lib";
|
||||
pkgs = import "${krops}/pkgs" { };
|
||||
importJson = (import <nixpkgs> { }).lib.importJSON;
|
||||
|
||||
regularSystem = { path, name, address }: {
|
||||
source = lib.evalSource [{
|
||||
niveum.file = toString ./.;
|
||||
system.file = toString path;
|
||||
nixos-config.symlink = "system/configuration.nix";
|
||||
|
||||
nixpkgs.git = gitFromJson .versions/nixpkgs.json // { shallow = true; };
|
||||
nixpkgs-unstable.git = gitFromJson .versions/nixpkgs-unstable.json // { shallow = true; };
|
||||
home-manager.git = gitFromJson .versions/home-manager.json;
|
||||
stockholm.git = gitFromJson .versions/stockholm.json;
|
||||
nix-writers.git = gitFromJson .versions/nix-writers.json;
|
||||
retiolum.git = gitFromJson .versions/retiolum.json;
|
||||
nixpkgs-mozilla.git = gitFromJson .versions/nixpkgs-mozilla.json;
|
||||
system-secrets.pass = {
|
||||
dir = toString ~/.password-store;
|
||||
name = "systems/${name}";
|
||||
};
|
||||
secrets.pass = {
|
||||
dir = toString ~/.password-store;
|
||||
name = "shared";
|
||||
};
|
||||
}];
|
||||
target = "root@${address}:${toString sshPort}";
|
||||
};
|
||||
inherit (pkgs.krops) writeDeploy;
|
||||
|
||||
deploy = {name, host}: writeCommand "/bin/system" {
|
||||
source = lib.evalSource [ (source name) ];
|
||||
force = true;
|
||||
target = lib.mkTarget "root@${host}:${toString sshPort}/var/krops/niveum";
|
||||
inherit command;
|
||||
};
|
||||
in {
|
||||
zaatar = writeDeploy "deploy-zaatar" (regularSystem {
|
||||
path = systems/zaatar;
|
||||
name = "zaatar";
|
||||
address = "zaatar.r";
|
||||
});
|
||||
kabsa = writeDeploy "deploy-kabsa" (regularSystem {
|
||||
path = systems/kabsa;
|
||||
name = "kabsa";
|
||||
address = "kabsa.r";
|
||||
});
|
||||
toum = writeDeploy "deploy-toum" (regularSystem {
|
||||
path = systems/toum;
|
||||
name = "toum";
|
||||
address = "toum.r";
|
||||
}) // {
|
||||
buildTarget = "${builtins.getEnv "USER"}@localhost/${builtins.getEnv "HOME"}/.cache/krops";
|
||||
};
|
||||
makanek = writeDeploy "deploy-makanek" (regularSystem {
|
||||
path = systems/makanek;
|
||||
name = "makanek";
|
||||
address = "makanek.r";
|
||||
});
|
||||
manakish = writeDeploy "deploy-manakish" (regularSystem {
|
||||
path = systems/manakish;
|
||||
name = "manakish";
|
||||
address = "manakish.r";
|
||||
});
|
||||
zaatar = deploy { name = "zaatar"; host = "zaatar.r"; };
|
||||
kabsa = deploy { name = "kabsa"; host = "kabsa.r"; };
|
||||
manakish = deploy { name = "manakish"; host = "manakish.r"; };
|
||||
makanek = deploy { name = "makanek"; host = "makanek.r"; };
|
||||
}
|
||||
|
||||
174
flake.lock
generated
Normal file
174
flake.lock
generated
Normal file
@@ -0,0 +1,174 @@
|
||||
{
|
||||
"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": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1639871969,
|
||||
"narHash": "sha256-6feWUnMygRzA9tzkrfAzpA5/NBYg75bkFxnqb1DtD7E=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "697cc8c68ed6a606296efbbe9614c32537078756",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "release-21.11",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"krops": {
|
||||
"inputs": {
|
||||
"flake-utils": [
|
||||
"flake-utils"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1632420452,
|
||||
"narHash": "sha256-ncK6vABW/Ku9XI0kqj1otarUfblryoQzSaOCnaZ0oSs=",
|
||||
"owner": "Mic92",
|
||||
"repo": "krops",
|
||||
"rev": "0388970c568905fedcbf429e5745aacd4f7a6633",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Mic92",
|
||||
"repo": "krops",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-writers": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1554228333,
|
||||
"narHash": "sha256-hG/PlcCvCQhNcU55NpHfATkyH9k6cZmO7uvBoJjasXU=",
|
||||
"ref": "master",
|
||||
"rev": "c528cf970e292790b414b4c1c8c8e9d7e73b2a71",
|
||||
"revCount": 32,
|
||||
"type": "git",
|
||||
"url": "https://cgit.krebsco.de/nix-writers"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://cgit.krebsco.de/nix-writers"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1640759603,
|
||||
"narHash": "sha256-k4d7oC6GvDV1OKxG325JUDpKtZcDUPEiddnJMOQQ/x8=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e101dc111ac1e5a21efca7822417acc1cb92013a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "release-21.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1640540585,
|
||||
"narHash": "sha256-cCmknKFjWgam9jq+58wSd0Z4REia8mjBP65kXcL3ki8=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "ac169ec6371f0d835542db654a65e0f2feb07838",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"retiolum": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1640734423,
|
||||
"narHash": "sha256-i/M1nyPnIEqV7K5dn0Q7V5mRtfzspH+AM6HbgPYGreI=",
|
||||
"owner": "krebs",
|
||||
"repo": "retiolum",
|
||||
"rev": "0e11e0119f330ea103a44e3502149ae50c1a299d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "krebs",
|
||||
"repo": "retiolum",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"home-manager": "home-manager",
|
||||
"krops": "krops",
|
||||
"nix-writers": "nix-writers",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||
"retiolum": "retiolum",
|
||||
"secrets": "secrets",
|
||||
"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": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1640733142,
|
||||
"narHash": "sha256-HzSEyYTGPoGAfgl+lZLb/DDUCQRoZ2iN7oTLhl+1KTQ=",
|
||||
"ref": "master",
|
||||
"rev": "687948cfe5154e03f93886dd27dc30c7910ba754",
|
||||
"revCount": 10222,
|
||||
"type": "git",
|
||||
"url": "https://cgit.krebsco.de/stockholm"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://cgit.krebsco.de/stockholm"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
99
flake.nix
Normal file
99
flake.nix
Normal file
@@ -0,0 +1,99 @@
|
||||
{
|
||||
description = "niveum systems";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/release-21.11";
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
|
||||
secrets = {
|
||||
url = "/home/kfm/.password-store";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
flake-utils = {
|
||||
url = "github:numtide/flake-utils";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-21.11";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
retiolum = {
|
||||
url = "github:krebs/retiolum";
|
||||
flake = false;
|
||||
};
|
||||
nix-writers = {
|
||||
url = "git+https://cgit.krebsco.de/nix-writers";
|
||||
flake = false;
|
||||
};
|
||||
stockholm = {
|
||||
url = "git+https://cgit.krebsco.de/stockholm";
|
||||
flake = false;
|
||||
};
|
||||
krops = {
|
||||
url = "github:Mic92/krops";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.flake-utils.follows = "flake-utils";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, stockholm, secrets, nixpkgs-unstable, home-manager, retiolum, krops, nix-writers, ... }@inputs:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
writeCommand = krops.packages.${system}.writeCommand;
|
||||
niveumSystem = configuration: nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = defaultModules ++ [ configuration ];
|
||||
};
|
||||
defaultModules = [
|
||||
{ _module.args.inputs = inputs; }
|
||||
({ pkgs, ... }: {
|
||||
nix = {
|
||||
nixPath = [ "nixpkgs=${pkgs.path}" ];
|
||||
package = pkgs.nixFlakes;
|
||||
extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
'';
|
||||
};
|
||||
nixpkgs.overlays = [
|
||||
(_self: _super: {
|
||||
unstable = nixpkgs-unstable.legacyPackages.${pkgs.system};
|
||||
})
|
||||
(import "${nix-writers}/pkgs")
|
||||
# (import <stockholm/krebs/5pkgs>)
|
||||
];
|
||||
})
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
}
|
||||
];
|
||||
in
|
||||
{
|
||||
nixosConfigurations = {
|
||||
kabsa = niveumSystem systems/kabsa/configuration.nix;
|
||||
makanek = niveumSystem systems/makanek/configuration.nix;
|
||||
manakish = niveumSystem systems/manakish/configuration.nix;
|
||||
zaatar = niveumSystem systems/zaatar/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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
imports = [
|
||||
./constants.nix
|
||||
./dropbox.nix
|
||||
./retiolum.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
{ pkgs, lib, config, ... }:
|
||||
with lib;
|
||||
let cfg = config.niveum.dropbox;
|
||||
in {
|
||||
options.niveum.dropbox = { enable = mkEnableOption "Dropbox"; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ pkgs.dropbox-cli ];
|
||||
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 17500 ];
|
||||
allowedUDPPorts = [ 17500 ];
|
||||
};
|
||||
|
||||
systemd.user.services.dropbox = {
|
||||
description = "Dropbox synchronisation service";
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.dropbox.out}/bin/dropbox";
|
||||
ExecReload = "${pkgs.coreutils.out}/bin/kill -HUP $MAINPID";
|
||||
KillMode = "control-group"; # upstream recommends process
|
||||
Restart = "on-failure";
|
||||
PrivateTmp = true;
|
||||
ProtectSystem = "full";
|
||||
Nice = 10;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{ inputs, config, pkgs, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
netname = "retiolum";
|
||||
cfg = config.networking.retiolum;
|
||||
inherit (inputs) retiolum;
|
||||
in {
|
||||
options = {
|
||||
networking.retiolum.ipv4 = mkOption {
|
||||
@@ -31,8 +32,8 @@ in {
|
||||
services.tinc.networks.${netname} = {
|
||||
name = cfg.nodename;
|
||||
hosts = builtins.mapAttrs
|
||||
(name: _: builtins.readFile "${<retiolum/hosts>}/${name}")
|
||||
(builtins.readDir <retiolum/hosts>);
|
||||
(name: _: builtins.readFile "${retiolum}/hosts/${name}")
|
||||
(builtins.readDir "${retiolum}/hosts");
|
||||
rsaPrivateKeyFile = toString <system-secrets/retiolum.key>;
|
||||
ed25519PrivateKeyFile = toString <system-secrets/retiolum.ed25519>;
|
||||
extraConfig = ''
|
||||
@@ -41,7 +42,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 ];
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
nixpkgs-unstable = import <nixpkgs-unstable> { config.allowUnfree = true; };
|
||||
inherit (import <niveum/lib>) retiolumAddresses;
|
||||
inherit (import ../../lib) retiolumAddresses;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
<niveum/configs/default.nix>
|
||||
<niveum/configs/battery.nix>
|
||||
<niveum/configs/networkmanager.nix>
|
||||
../../configs/default.nix
|
||||
../../configs/battery.nix
|
||||
../../configs/networkmanager.nix
|
||||
./hardware-configuration.nix
|
||||
# <stockholm/krebs/2configs/hw/x220.nix>
|
||||
];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ config, lib, pkgs, ... }: {
|
||||
imports = [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix> ];
|
||||
{ config, lib, pkgs, modulesPath, ... }: {
|
||||
imports = [ "${modulesPath}/installer/scan/not-detected.nix" ];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "xhci_pci" "usb_storage" "sd_mod" "sdhci_pci" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
|
||||
Reference in New Issue
Block a user