1
0

18 Commits

Author SHA1 Message Date
091abaea4a Merge branch 'migrate-to-lix' 2025-01-01 11:54:16 +01:00
bea417fe8e flake.nix: Use lix hydra 2024-12-31 20:38:22 +01:00
1f373851d1 flake.nix: Add lix 2024-12-31 19:24:16 +01:00
a6e2d7a78d flake.lock: Update solid-xmpp-alarm 2024-12-17 18:38:39 +01:00
cc89b20a2c pkgs/overrides/xmppc: patch to read password from file 2024-12-16 17:31:57 +01:00
75af9b7383 pkgs/factorio-launcher: Add wrapper to launch factorio 2024-12-09 20:34:07 +01:00
36c6ada07c flake.lock: Update scan-to-gpg 2024-12-09 18:53:17 +01:00
962acece38 hosts/carbon: Fix broken per start script generation 2024-12-09 18:34:32 +01:00
be1fc59843 configuration/desktop: Tune upower tresholds 2024-12-01 20:11:42 +01:00
3cff496e74 Merge remote-tracking branch 'origin/updated-inputs-2024-11-27-02-03' 2024-11-29 19:15:51 +01:00
45e14d65ec hosts/web-2: Upgrade to postgresql 16 2024-11-29 19:14:14 +01:00
Flake Update Bot
c54004b102 Update nixpkgs 2024-11-27-02-03 2024-11-27 03:04:05 +01:00
a76e8cf3c0 hosts/carbon: Add scan-to-gpg 2024-11-24 20:43:27 +01:00
6dc38cf21e hosts/carbon: Add net-printer 2024-11-23 23:00:19 +01:00
dff6bb1a4e configuration/desktop: Add global mic mute shortcut 2024-11-22 09:46:02 +01:00
c63a781dc6 pkgs/clerie-sops: regenerate clerie-sops-config on every call to clerie-sops 2024-11-21 22:31:42 +01:00
0e00c74ba7 configuration/desktop: Handle renamed font in future releases 2024-11-21 13:45:26 +01:00
923229dc00 configuration/common: Allow overriding nix version per host 2024-11-21 13:25:27 +01:00
22 changed files with 571 additions and 49 deletions

View File

@@ -62,8 +62,6 @@
};
};
nix.package = pkgs.nixVersions.nix_2_18;
documentation.doc.enable = false;
environment.systemPackages = with pkgs; [

View File

@@ -7,8 +7,7 @@
roboto
roboto-mono
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
comfortaa
];
] ++ (if pkgs ? "noto-fonts-cjk-sans" then [ pkgs.noto-fonts-cjk-sans ] else [ pkgs.noto-fonts-cjk ]);
}

View File

@@ -16,6 +16,7 @@
custom-keybindings = [
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/terminal/"
];
mic-mute = [ "<Control>Print" ];
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/terminal" = {
name = "Terminal";

View File

@@ -9,6 +9,12 @@
HibernateDelaySec=30m
'';
services.upower = {
percentageLow = 20;
percentageCritical = 10;
percentageAction = 8;
};
programs.dconf.profiles = {
user.databases = [
{

330
flake.lock generated
View File

@@ -98,6 +98,22 @@
"url": "https://git.clerie.de/clerie/fieldpoc.git"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
@@ -120,6 +136,28 @@
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"hydra",
"nix-eval-jobs",
"nixpkgs"
]
},
"locked": {
"lastModified": 1730504689,
"narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "506278e768c2a08bec68eb62932193e341f55c90",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_3": {
"inputs": {
"nixpkgs-lib": [
"ssh-to-age",
@@ -158,6 +196,39 @@
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flakey-profile": {
"locked": {
"lastModified": 1712898590,
"narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=",
"owner": "lf-",
"repo": "flakey-profile",
"rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d",
"type": "github"
},
"original": {
"owner": "lf-",
"repo": "flakey-profile",
"type": "github"
}
},
"harmonia": {
"inputs": {
"flake-parts": "flake-parts",
@@ -181,6 +252,91 @@
"type": "github"
}
},
"hydra": {
"inputs": {
"lix": "lix",
"nix-eval-jobs": "nix-eval-jobs",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1733503045,
"narHash": "sha256-VoMam8Zzbk+X6dIYwH2f9NqItL6g9YDhQvGybzSl8xQ=",
"ref": "refs/heads/main",
"rev": "eccf01d4fef67f87b6383f96c73781bd08b686ac",
"revCount": 4230,
"type": "git",
"url": "https://git.lix.systems/lix-project/hydra.git"
},
"original": {
"type": "git",
"url": "https://git.lix.systems/lix-project/hydra.git"
}
},
"lix": {
"inputs": {
"flake-compat": "flake-compat",
"nix2container": "nix2container",
"nixpkgs": [
"hydra",
"nixpkgs"
],
"nixpkgs-regression": "nixpkgs-regression",
"pre-commit-hooks": "pre-commit-hooks"
},
"locked": {
"lastModified": 1732112222,
"narHash": "sha256-H7GN4++a4vE49SUNojZx+FSk4mmpb2ifJUtJMJHProI=",
"ref": "refs/heads/main",
"rev": "66f6dbda32959dd5cf3a9aaba15af72d037ab7ff",
"revCount": 16513,
"type": "git",
"url": "https://git.lix.systems/lix-project/lix"
},
"original": {
"type": "git",
"url": "https://git.lix.systems/lix-project/lix"
}
},
"lix-module": {
"inputs": {
"flake-utils": "flake-utils_2",
"flakey-profile": "flakey-profile",
"lix": "lix_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1732605668,
"narHash": "sha256-DN5/166jhiiAW0Uw6nueXaGTueVxhfZISAkoxasmz/g=",
"ref": "stable",
"rev": "96824d606a6656650bbe436366bc89d5ee3a6573",
"revCount": 113,
"type": "git",
"url": "https://git.lix.systems/lix-project/nixos-module.git"
},
"original": {
"ref": "stable",
"type": "git",
"url": "https://git.lix.systems/lix-project/nixos-module.git"
}
},
"lix_2": {
"flake": false,
"locked": {
"lastModified": 1729298361,
"narHash": "sha256-hiGtfzxFkDc9TSYsb96Whg0vnqBVV7CUxyscZNhed0U=",
"rev": "ad9d06f7838a25beec425ff406fe68721fef73be",
"type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/ad9d06f7838a25beec425ff406fe68721fef73be.tar.gz?rev=ad9d06f7838a25beec425ff406fe68721fef73be"
},
"original": {
"type": "tarball",
"url": "https://git.lix.systems/lix-project/lix/archive/2.91.1.tar.gz"
}
},
"mitel-ommclient2": {
"inputs": {
"nixpkgs": [
@@ -202,6 +358,72 @@
"url": "https://git.clerie.de/clerie/mitel_ommclient2.git"
}
},
"nix-eval-jobs": {
"inputs": {
"flake-parts": "flake-parts_2",
"lix": [
"hydra",
"lix"
],
"nix-github-actions": "nix-github-actions",
"nixpkgs": [
"hydra",
"nixpkgs"
],
"treefmt-nix": "treefmt-nix_2"
},
"locked": {
"lastModified": 1732351635,
"narHash": "sha256-H94CcQ3yamG5+RMxtxXllR02YIlxQ5WD/8PcolO9yEA=",
"ref": "refs/heads/main",
"rev": "dfc286ca3dc49118c30d8d6205d6d6af76c62b7a",
"revCount": 617,
"type": "git",
"url": "https://git.lix.systems/lix-project/nix-eval-jobs"
},
"original": {
"type": "git",
"url": "https://git.lix.systems/lix-project/nix-eval-jobs"
}
},
"nix-github-actions": {
"inputs": {
"nixpkgs": [
"hydra",
"nix-eval-jobs",
"nixpkgs"
]
},
"locked": {
"lastModified": 1731952509,
"narHash": "sha256-p4gB3Rhw8R6Ak4eMl8pqjCPOLCZRqaehZxdZ/mbFClM=",
"owner": "nix-community",
"repo": "nix-github-actions",
"rev": "7b5f051df789b6b20d259924d349a9ba3319b226",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-github-actions",
"type": "github"
}
},
"nix2container": {
"flake": false,
"locked": {
"lastModified": 1724996935,
"narHash": "sha256-njRK9vvZ1JJsP8oV2OgkBrpJhgQezI03S7gzskCcHos=",
"owner": "nlewo",
"repo": "nix2container",
"rev": "fa6bb0a1159f55d071ba99331355955ae30b3401",
"type": "github"
},
"original": {
"owner": "nlewo",
"repo": "nix2container",
"type": "github"
}
},
"nixos-exporter": {
"inputs": {
"nixpkgs": [
@@ -254,6 +476,22 @@
"type": "github"
}
},
"nixpkgs-regression": {
"locked": {
"lastModified": 1643052045,
"narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1713434076,
@@ -288,11 +526,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1732014248,
"narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=",
"lastModified": 1732521221,
"narHash": "sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "23e89b7da85c3640bbc2173fe04f4bd114342367",
"rev": "4633a7c72337ea8fd23a4f2ba3972865e3ec685d",
"type": "github"
},
"original": {
@@ -322,6 +560,22 @@
"url": "https://git.clerie.de/clerie/nurausstieg.git"
}
},
"pre-commit-hooks": {
"flake": false,
"locked": {
"lastModified": 1726745158,
"narHash": "sha256-D5AegvGoEjt4rkKedmxlSEmC+nNLMBPWFxvmYnVLhjk=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "4e743a6920eab45e8ba0fbe49dc459f1423a4b74",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"berlinerbaeder-exporter": "berlinerbaeder-exporter",
@@ -330,15 +584,38 @@
"fernglas": "fernglas",
"fieldpoc": "fieldpoc",
"harmonia": "harmonia",
"hydra": "hydra",
"lix-module": "lix-module",
"nixos-exporter": "nixos-exporter",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3",
"nurausstieg": "nurausstieg",
"scan-to-gpg": "scan-to-gpg",
"solid-xmpp-alarm": "solid-xmpp-alarm",
"sops-nix": "sops-nix",
"ssh-to-age": "ssh-to-age"
}
},
"scan-to-gpg": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1733765838,
"narHash": "sha256-piKf5W1vUl4y36WuW/192LMXBJyATBF83T9YEz9K3/Y=",
"ref": "refs/heads/main",
"rev": "b0c07f95146d85a7b62a84fb2a62a773a5942733",
"revCount": 17,
"type": "git",
"url": "https://git.clerie.de/clerie/scan-to-gpg.git"
},
"original": {
"type": "git",
"url": "https://git.clerie.de/clerie/scan-to-gpg.git"
}
},
"solid-xmpp-alarm": {
"inputs": {
"nixpkgs": [
@@ -346,11 +623,11 @@
]
},
"locked": {
"lastModified": 1675686574,
"narHash": "sha256-+Xww9mfKbUP4VRPtAJKZ6+YdBYL/0vgGoBXVC9AvmQw=",
"lastModified": 1734450899,
"narHash": "sha256-SyUOl5YUl/nlZNNM2/vSuFWFdxOCKmTO4BxjIxwVcjQ=",
"ref": "refs/heads/main",
"rev": "79730bd7df798d80c526c42bbd526506f0235ea3",
"revCount": 4,
"rev": "4bfa8ec27b99e774906c82e6d51d13b32a3ff161",
"revCount": 6,
"type": "git",
"url": "https://git.clerie.de/clerie/solid-xmpp-alarm.git"
},
@@ -382,7 +659,7 @@
},
"ssh-to-age": {
"inputs": {
"flake-parts": "flake-parts_2",
"flake-parts": "flake-parts_3",
"nixpkgs": [
"nixpkgs"
]
@@ -416,6 +693,21 @@
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
@@ -436,6 +728,28 @@
"repo": "treefmt-nix",
"type": "github"
}
},
"treefmt-nix_2": {
"inputs": {
"nixpkgs": [
"hydra",
"nix-eval-jobs",
"nixpkgs"
]
},
"locked": {
"lastModified": 1732292307,
"narHash": "sha256-5WSng844vXt8uytT5djmqBCkopyle6ciFgteuA9bJpw=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "705df92694af7093dfbb27109ce16d828a79155f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
}
},
"root": "root",

View File

@@ -22,6 +22,14 @@
url = "github:nix-community/harmonia/harmonia-v1.0.2";
inputs.nixpkgs.follows = "nixpkgs";
};
hydra = {
url = "git+https://git.lix.systems/lix-project/hydra.git";
inputs.nixpkgs.follows = "nixpkgs";
};
lix-module = {
url = "git+https://git.lix.systems/lix-project/nixos-module.git?ref=stable";
inputs.nixpkgs.follows = "nixpkgs";
};
fieldpoc.url = "git+https://git.clerie.de/clerie/fieldpoc.git";
nixos-exporter = {
url = "git+https://git.clerie.de/clerie/nixos-exporter.git";
@@ -31,6 +39,10 @@
url = "git+https://git.clerie.de/clerie/nurausstieg.git";
inputs.nixpkgs.follows = "nixpkgs";
};
scan-to-gpg = {
url = "git+https://git.clerie.de/clerie/scan-to-gpg.git";
inputs.nixpkgs.follows = "nixpkgs";
};
solid-xmpp-alarm = {
url = "git+https://git.clerie.de/clerie/solid-xmpp-alarm.git";
inputs.nixpkgs.follows = "nixpkgs";
@@ -122,6 +134,7 @@
clerie-sops-config
clerie-sops-edit
chromium-incognito
factorio-launcher
git-checkout-github-pr
git-diff-word
git-pp
@@ -136,7 +149,8 @@
run-with-docker-group
ssh-gpg
update-from-hydra
uptimestatus;
uptimestatus
xmppc;
});
inherit lib self;

View File

@@ -1,7 +1,9 @@
{ self
, fernglas
, fieldpoc
, lix-module
, nixos-exporter
, scan-to-gpg
, solid-xmpp-alarm
, sops-nix
, ...
@@ -12,7 +14,9 @@
imports = [
fernglas.nixosModules.default
fieldpoc.nixosModules.default
lix-module.nixosModules.default
nixos-exporter.nixosModules.default
scan-to-gpg.nixosModules.scan-to-gpg
solid-xmpp-alarm.nixosModules.solid-xmpp-alarm
sops-nix.nixosModules.sops
];

View File

@@ -3,7 +3,9 @@
, bij
, chaosevents
, harmonia
, hydra
, nurausstieg
, scan-to-gpg
, ssh-to-age
, ...
}@inputs:
@@ -17,8 +19,12 @@ final: prev: {
harmonia = harmonia.packages.${final.system}.harmonia.override {
nixForHarmonia = final.nixVersions.nix_2_23;
};
inherit (hydra.packages.${final.system})
hydra;
inherit (nurausstieg.packages.${final.system})
nurausstieg;
inherit (scan-to-gpg.packages.${final.system})
scan-to-gpg;
inherit (ssh-to-age.packages.${final.system})
ssh-to-age;
}

View File

@@ -14,9 +14,11 @@
./net-iot.nix
./net-lte.nix
./net-mgmt.nix
./net-printer.nix
./net-voip.nix
./ntp.nix
./ppp.nix
./scan-to-gpg.nix
./wg-clerie.nix
];

View File

@@ -0,0 +1,51 @@
{ ... }:
{
networking.vlans."enp1s0.206" = {
id = 206;
interface = "enp1s0";
};
networking.bridges."net-printer".interfaces = [
"enp1s0.206"
];
networking.interfaces."net-printer".ipv4.addresses = [
{ address = "10.152.206.1"; prefixLength = 24; }
];
services.kea.dhcp4 = {
settings = {
interfaces-config = {
interfaces = [ "net-printer" ];
};
subnet4 = [
{
id = 206;
subnet = "10.152.206.0/24";
pools = [
{
pool = "10.152.206.100 - 10.152.206.240";
}
];
option-data = [
{
name = "routers";
data = "10.152.206.1";
}
];
}
];
};
};
# Enable scan-to-gpg
networking.firewall.interfaces."net-printer".allowedTCPPorts = [ 2121 ];
networking.firewall.interfaces."net-printer".allowedTCPPortRanges = [ { from = 2130; to = 2134; } ];
clerie.firewall.extraForwardFilterCommands = ''
# Allow access from Heimnetz to printer
ip46tables -A forward-filter -i net-heimnetz -o net-printer -j ACCEPT
ip46tables -A forward-filter -i net-printer -j DROP
ip46tables -A forward-filter -o net-printer -j DROP
'';
}

View File

@@ -1,4 +1,4 @@
{ config, pkgs, utils, ... }:
{ config, pkgs, lib, ... }:
{
@@ -44,12 +44,15 @@
cat ${config.sops.secrets.pppd-dtagdsl-secrets.path} > /etc/ppp/chap-secrets
'';
preStartFile = utils.systemdUtils.lib.makeJobScript "pppd-dtagdsl-pre-start" preStart;
preStartFile = pkgs.writeShellApplication {
name = "pppd-dtagdsl-pre-start";
text = preStart;
};
in {
EnvironmentFile = config.sops.secrets.pppd-dtagdsl-username.path;
ExecStartPre = [
# "+" marks script to be executed without priviledge restrictions
"+${preStartFile}"
"+${lib.getExe preStartFile}"
];
};

View File

@@ -0,0 +1,11 @@
{ pkgs, ... }:
{
services.scan-to-gpg = {
enable = true;
gpgkey = "${pkgs.clerie-keys}/gpg/clerie@clerie.de.asc";
};
users.users."clerie".extraGroups = [ "scan-to-gpg" ];
}

View File

@@ -29,6 +29,8 @@
chromium-incognito
print-afra
factorio-launcher
];
# Wireshark

View File

@@ -50,7 +50,7 @@
services.postgresql = {
enable = true;
package = pkgs.postgresql_12;
package = pkgs.postgresql_16;
};
clerie.backup = {

View File

@@ -9,6 +9,8 @@
#cura # libarcus library is currently broken, required for curaengine
mumble
factorio-launcher
];
}

View File

@@ -1,37 +1,19 @@
{ pkgs, lib, ... }:
with lib;
pkgs.python313Packages.buildPythonPackage rec {
pname = "clerie-sops-config";
version = "0.0.1";
let
hosts = builtins.attrNames (builtins.readDir ../../hosts);
src = ./.;
mkAgeKey = hostname: ssh_pub_file:
pkgs.runCommand "${hostname}.age" {
buildInputs = [ pkgs.ssh-to-age ];
} ''
ssh-to-age -i ${ssh_pub_file} -o $out
'';
format = "other";
ageKeysForHost = hostname: let
ssh_pub_file = ../../hosts + "/${hostname}/ssh.pub";
in
if builtins.pathExists ssh_pub_file then [
(fileContents (mkAgeKey hostname ssh_pub_file))
] else [];
propagatedBuildInputs = with pkgs; [
ssh-to-age
];
mkCreationRules = hosts:
map (hostname: {
path_regex = escapeRegex "hosts/${hostname}/secrets.json";
key_groups = [{
pgp = [
(fileContents (pkgs.clerie-keys + "/gpg/clerie@clerie.de.fingerprint.txt"))
];
age = ageKeysForHost hostname;
}];
}) hosts;
sops_config = {
creation_rules = mkCreationRules hosts;
};
in
pkgs.writeText "sops.json" (builtins.toJSON sops_config)
installPhase = ''
mkdir -p $out/bin
cp clerie-sops-config.py $out/bin/clerie-sops-config
'';
}

View File

@@ -0,0 +1,55 @@
#!/usr/bin/env python3
import sys
import json
from pathlib import Path
import re
import subprocess
def generate_sops_config(repo_root):
admin_keys = []
# hardcode fingerprints because we can't really generate them automatically currently
admin_keys.append("0C982F87B7AFBA0F504F90A2629E741947C87928") # clerie@clerie.de
list_of_host_directories = sorted(list(filter(lambda path_object: path_object.is_dir(), (repo_root / "hosts").iterdir())))
creation_rules = []
for host_directory in list_of_host_directories:
host_secrets_file = host_directory / "secrets.json"
host_keys = []
ssh_host_key_file = host_directory / "ssh.pub"
if ssh_host_key_file.is_file():
ssh_to_age_command = subprocess.run(["ssh-to-age", "-i", str(ssh_host_key_file)], capture_output=True, text=True)
if ssh_to_age_command.returncode == 0:
host_keys.append(ssh_to_age_command.stdout.strip())
creation_rules.append({
"key_groups": [{
"age": host_keys,
"pgp": admin_keys,
}],
"path_regex": re.escape(str(host_secrets_file)),
})
return {
"creation_rules": creation_rules,
}
if __name__ == "__main__":
if len(sys.argv) != 2:
print("No repo root specified")
exit(1)
repo_root = Path(sys.argv[1])
sops_config = generate_sops_config(repo_root)
print(json.dumps(sops_config))

View File

@@ -4,8 +4,13 @@ pkgs.writeShellApplication {
name = "clerie-sops";
runtimeInputs = with pkgs; [
sops
clerie-sops-config
];
text = ''
exec sops --config ${pkgs.clerie-sops-config} "$@"
REPO_ROOT="."
if GIT_ROOT=$(git rev-parse --show-toplevel); then
REPO_ROOT="$GIT_ROOT"
fi
exec sops --config <(clerie-sops-config "$REPO_ROOT") "$@"
'';
}

View File

@@ -0,0 +1,25 @@
{ pkgs, lib, ... }:
pkgs.buildFHSEnv {
name = "factorio-launcher";
targetPkgs = pkgs: (with pkgs; [
alsa-lib
libGL
libpulseaudio
libxkbcommon
wayland
]) ++ (with pkgs.xorg; [
libICE
libSM
libX11
libXcursor
libXext
libXi
libXinerama
libXrandr
]);
runScript = lib.getExe (pkgs.writeShellApplication {
name = "launch-factorio";
text = builtins.readFile ./launch-factorio.sh;
});
}

View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -euo pipefail
if [[ $# -eq 0 ]]; then
echo "Pass path to factorio install directory as first argument"
exit 1
fi
FACTORIO_BINARY_PATH=""
for suffix in "" "/factorio" "/x64/factorio" "/bin/x64/factorio" "/factorio/bin/x64/factorio"; do
if [[ -f "$1${suffix}" && -x "$1${suffix}" ]]; then
FACTORIO_BINARY_PATH="$1${suffix}"
break
fi
done
if [[ -z $FACTORIO_BINARY_PATH ]]; then
echo "No factorio executable found below $1"
exit 1
fi
shift
set -- "${FACTORIO_BINARY_PATH}" "$@"
exec "$@"

View File

@@ -7,6 +7,7 @@ final: prev: {
clerie-sops-edit = final.callPackage ./clerie-sops/clerie-sops-edit.nix {};
clerie-update-nixfiles = final.callPackage ./clerie-update-nixfiles/clerie-update-nixfiles.nix {};
chromium-incognito = final.callPackage ./chromium-incognito {};
factorio-launcher = final.callPackage ./factorio-launcher {};
git-checkout-github-pr = final.callPackage ./git-checkout-github-pr {};
git-diff-word = final.callPackage ./git-diff-word {};
git-pp = final.callPackage ./git-pp {};
@@ -21,4 +22,6 @@ final: prev: {
ssh-gpg = final.callPackage ./ssh-gpg {};
update-from-hydra = final.callPackage ./update-from-hydra {};
uptimestatus = final.python3.pkgs.callPackage ./uptimestatus {};
xmppc = import ./overrides/xmppc.nix final prev;
}

11
pkgs/overrides/xmppc.nix Normal file
View File

@@ -0,0 +1,11 @@
final: prev:
prev.xmppc.overrideAttrs (finalAttrs: prevAttrs: {
version = "0.1.2-clerie-custom";
patches = [
(final.fetchpatch {
# read password from file
url = "https://codeberg.org/Anoxinon_e.V./xmppc/pulls/38.patch";
hash = "sha256-gAD0mfuvqqC7AFtMdtbW+tJiD1F9tOP6/E0eJayDXqc=";
})
];
})