diff --git a/home-manager/roles/default.nix b/home-manager/roles/default.nix index dd8a70a3..fca8734e 100644 --- a/home-manager/roles/default.nix +++ b/home-manager/roles/default.nix @@ -1,6 +1,5 @@ { pkgs, config, lib, ... }: -let inherit (config.m-0.private) me meWork; -in { +{ imports = [ ./zsh @@ -65,8 +64,8 @@ in { ".hledger-web_client_session_key.aes" ".nix-gc-roots" ]; - userEmail = me.mail; - userName = me.name; + userEmail = "malte.brandy@maralorn.de"; + userName = "Malte Brandy"; }; htop = { enable = true; @@ -97,28 +96,24 @@ in { }; hera = { hostname = "hera.m-0.eu"; - user = me.user; + user = "maralorn"; }; ag-forward = { hostname = agHost; proxyCommand = matheGwProxy; - user = meWork.user; + user = "brandy"; }; ag = { hostname = agHost; - user = meWork.user; + user = "brandy"; }; gw = { hostname = "gwres4.mathematik.tu-darmstadt.de"; - user = meWork.user; + user = "brandy"; }; shells = { hostname = "shells.darmstadt.ccc.de"; - user = me.user; - }; - vorstand = { - hostname = "vorstand.darmstadt.ccc.de"; - user = me.user; + user = "maralorn"; }; whisky = { hostname = "whisky.w17.io"; @@ -138,7 +133,7 @@ in { sessionVariables = { PATH = "$HOME/.nix-profile/bin:$PATH"; BROWSER = "${pkgs.firefox}/bin/firefox"; - EMAIL = me.mail; + EMAIL = "malte.brandy@maralorn.de"; SUDO_ASKPASS = let print-pw = pkgs.writeShellScriptBin "print-pw" "pass show eu/m-0/${config.m-0.hostName}.m-0.eu/${config.home.username}"; diff --git a/home-manager/roles/laptop.nix b/home-manager/roles/laptop.nix index 0a2fc112..d4b47395 100644 --- a/home-manager/roles/laptop.nix +++ b/home-manager/roles/laptop.nix @@ -24,12 +24,18 @@ in { ''; updateModes = pkgs.writeHaskellScript { name = "update-modes"; - bins = [ activateMode ]; + bins = [ activateMode pkgs.git ]; } '' + params = ["${configPath}/home-manager/target.nix", "-A", "apollo", "-o", "/home/maralorn/.modes"] + main = do say "Building ~/.modes for apollo" nixPath <- myNixPath "${configPath}" - nix_build nixPath "${configPath}/home-manager/target.nix" "-A" "apollo" "-o" "/home/maralorn/.modes" + privateDeinit :: Either SomeException () <- try $ git "submodule" "deinit" "${configPath}" + when (isRight privateDeinit) $ do + nix_build nixPath (params ++ remoteBuildParams) + git "submodule" "update" "--init" "${configPath}" + nix_build nixPath params activate_mode ''; selectMode = pkgs.writeHaskellScript { diff --git a/home-manager/roles/mail.nix b/home-manager/roles/mail.nix index 265a39df..9ae30bef 100644 --- a/home-manager/roles/mail.nix +++ b/home-manager/roles/mail.nix @@ -24,9 +24,9 @@ let simpleSortList = listName: simple "List:${listName}" "list/${toFolder listName}"; }; - myFilters = builtins.map filter.simpleSortList sortLists - ++ builtins.map filter.stupidList stupidLists - ++ builtins.map filter.notifications notifications; + myFilters = builtins.map filter.simpleSortList lists.sortLists + ++ builtins.map filter.stupidList lists.stupidLists + ++ builtins.map filter.notifications lists.notifications; sortMail = pkgs.writeHaskellScript { name = "sort-mail-archive"; bins = [ pkgs.notmuch pkgs.coreutils pkgs.mblaze pkgs.findutils ]; @@ -117,7 +117,7 @@ in { }; systemd.user.timers.mbsync.Timer.RandomizedDelaySec = "10m"; - accounts.email.accounts = pkgs.privateValue {} "mail/accounts"; + accounts.email.accounts = pkgs.privateValue { } "mail/accounts"; systemd.user.services = let mkService = name: account: let diff --git a/lib/update-system.nix b/lib/update-system.nix index 8b3a1ef7..68fb4992 100644 --- a/lib/update-system.nix +++ b/lib/update-system.nix @@ -3,11 +3,15 @@ let configPath = "/etc/nixos"; in { update-system = pkgs.writeHaskellScript { name = "update-system"; - bins = [ nixos-rebuild ]; + bins = [ nixos-rebuild pkgs.git ]; } '' main = do paths <- myNixPath "${configPath}" args <- getArgs + privateDeinit :: Either SomeException () <- try $ git "-C" "${configPath}" "submodule" "deinit" "private" + when (isRight privateDeinit) $ do + nixos_rebuild (paths ++ ["build"] ++ remoteBuildParams ++ fmap toString args) + git "-C" "${configPath}" "submodule" "update" "--init" "private" nixos_rebuild (paths ++ ["switch"] ++ fmap toString args) ''; } diff --git a/nixos/machines/apollo/configuration.nix b/nixos/machines/apollo/configuration.nix index 41b6f7dd..0113fccb 100644 --- a/nixos/machines/apollo/configuration.nix +++ b/nixos/machines/apollo/configuration.nix @@ -81,6 +81,7 @@ in { // { cert = pkgs.privatePath "syncthing/apollo/cert.pem"; key = pkgs.privatePath "syncthing/apollo/key.pem"; + }; }; gnome3.chrome-gnome-shell.enable = true; xserver = { @@ -91,15 +92,5 @@ in { }; boot.kernel.sysctl = { "fs.inotify.max_user_watches" = 204800; }; - #cdark_net = { - #enable = true; - #hostName = "${me.user}_${config.networking.hostName}"; - #ed25519PrivateKeyFile = /etc/nixos/nixos/machines - #+ "/${config.networking.hostName}" + /secret/tinc/ed25519_key.priv; - #hostsDirectory = - #pkgs.fetchgit { url = "ssh://git@git.darmstadt.ccc.de/cdark.net/hosts"; }; - #ip6address = "fd23:42:cda:4342::2"; - #ip4address = "172.20.71.2"; - #}; system.stateVersion = "19.09"; } diff --git a/overlays/testing.nix b/overlays/testing.nix index e4af0b39..a02c95a3 100644 --- a/overlays/testing.nix +++ b/overlays/testing.nix @@ -61,8 +61,8 @@ in { git "-C" repoDir "config" "user.name" "maralorn (nix-auto-updater)" git "-C" repoDir "commit" "-am" "Update dependencies with niv" concurrently_ - (mapConcurrently_ (\x -> test_system_config repoDir x "--builders" "@/etc/nix/machines" "--max-jobs" "0") ${self.haskellList systems}) - (mapConcurrently_ (\x -> test_home_config repoDir x "--builders" "@/etc/nix/machines" "--max-jobs" "0") ${self.haskellList homes}) + (mapConcurrently_ (\x -> test_system_config repoDir x remoteBuildParams) ${self.haskellList systems}) + (mapConcurrently_ (\x -> test_home_config repoDir x remoteBuildParams) ${self.haskellList homes}) git "-C" repoDir "submodule" "update" "--init" concurrently_ (mapConcurrently_ (test_system_config repoDir) ${self.haskellList systems}) diff --git a/overlays/writeHaskellScript.nix b/overlays/writeHaskellScript.nix index 370fa1e0..64064f79 100644 --- a/overlays/writeHaskellScript.nix +++ b/overlays/writeHaskellScript.nix @@ -55,6 +55,9 @@ self: super: { tag name str = ["-I", [i|#{name :: Text}=#{str :: Text}|]] :: [String] getNivAssign name = tag name <$> getNivPath path name + remoteBuildParams :: [String] + remoteBuildParams = ["--builders", "@/etc/nix/machines", "--max-jobs", "0"] + main :: IO () ${code} ''; diff --git a/private b/private index 7250f095..5c213f10 160000 --- a/private +++ b/private @@ -1 +1 @@ -Subproject commit 7250f095fbed52e5dc3b10aa3af2f0874031efe2 +Subproject commit 5c213f10c5db7e8f11a36d660902ac7183ce177f