From ec7f5f5bb1032cef977880ed9c8391dc9fa8ed4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Thu, 25 Dec 2025 08:13:48 +0100 Subject: [PATCH] networkmanager-declarative: remove --- flake.nix | 1 - modules/networkmanager-declarative.nix | 69 -------------------------- 2 files changed, 70 deletions(-) delete mode 100644 modules/networkmanager-declarative.nix diff --git a/flake.nix b/flake.nix index 5b5958a..9889db3 100644 --- a/flake.nix +++ b/flake.nix @@ -140,7 +140,6 @@ nixosModules = { moodle-dl = import modules/moodle-dl.nix; - networkmanager-declarative = import modules/networkmanager-declarative.nix; passport = import modules/passport.nix; panoptikon = import modules/panoptikon.nix; power-action = import modules/power-action.nix; diff --git a/modules/networkmanager-declarative.nix b/modules/networkmanager-declarative.nix deleted file mode 100644 index da3f5d5..0000000 --- a/modules/networkmanager-declarative.nix +++ /dev/null @@ -1,69 +0,0 @@ -# https://github.com/jmackie/nixos-networkmanager-profiles/ -{ - lib, - config, - ... -}: -with lib; let - nm = config.networking.networkmanager; - - mkProfile = profileAttrs: - if !(isAttrs profileAttrs) - then throw "error 1" - else { - enable = true; - mode = "0400"; # readonly (user) - text = - (foldlAttrs (accum: { - name, - value, - }: '' - ${accum} - - [${name}] ${mkProfileEntry value}'') - "# Generated by nixos-networkmanager-profiles" - profileAttrs) - + "\n"; - }; - - mkProfileEntry = entryAttrs: - if !(isAttrs entryAttrs) - then throw "error 2" - else - foldlAttrs (accum: { - name, - value, - }: '' - ${accum} - ${name}=${toString value}'') "" - entryAttrs; - - foldlAttrs = op: nul: attrs: - foldl (accum: { - fst, - snd, - }: - op accum (nameValuePair fst snd)) - nul - (lists.zipLists (attrNames attrs) (attrValues attrs)); - - attrLength = attrs: length (attrValues attrs); -in { - options.networking.networkmanager.profiles = mkOption { - type = types.attrs; - default = {}; - }; - - config = mkIf (attrLength nm.profiles > 0) { - environment.etc = foldlAttrs (accum: { - name, - value, - }: - accum - // { - "NetworkManager/system-connections/${name}.nmconnection" = - mkProfile value; - }) {} - nm.profiles; - }; -}