From e10958c806ecb5b5e630f88034f5fb2926bd0ee9 Mon Sep 17 00:00:00 2001 From: Frantisek Bohacek Date: Sun, 15 Oct 2023 13:06:07 +0200 Subject: [PATCH] chore: move semi-secrets to separate flake --- flake.lock | 34 +++++++++++++++++++++++++++++++++- flake.nix | 2 ++ hosts/desktop/default.nix | 3 +-- hosts/laptop/default.nix | 2 +- modules/services/syncthing.nix | 2 +- modules/services/wireguard.nix | 9 +++++---- 6 files changed, 43 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index fccb53f..08bce20 100644 --- a/flake.lock +++ b/flake.lock @@ -165,6 +165,19 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1697059129, + "narHash": "sha256-9NJcFF9CEYPvHJ5ckE8kvINvI84SZZ87PvqMbH6pro0=", + "path": "/nix/store/xjviahzwa7x51vl51kc3c1k1n1jmhpd5-source", + "rev": "5e4c2ada4fcd54b99d56d7bd62f384511a7e2593", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, "nur": { "locked": { "lastModified": 1697215604, @@ -188,7 +201,26 @@ "nixgl": "nixgl", "nixpkgs": "nixpkgs", "nixpkgs-stable": "nixpkgs-stable", - "nur": "nur" + "nur": "nur", + "semi-secrets": "semi-secrets" + } + }, + "semi-secrets": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1697366661, + "narHash": "sha256-KHjt9B1ErMPrQry85NG70I9cKGrMgkcwbSJOcxSoF+I=", + "ref": "refs/heads/main", + "rev": "2a6756dc9390401e8c64ee94514719ef3d548d85", + "revCount": 1, + "type": "git", + "url": "file:///home/ruther/.semi-secrets" + }, + "original": { + "type": "git", + "url": "file:///home/ruther/.semi-secrets" } }, "systems": { diff --git a/flake.nix b/flake.nix index a2b8506..0992006 100644 --- a/flake.nix +++ b/flake.nix @@ -14,6 +14,8 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.05"; + semi-secrets.url = "git+file:///home/ruther/.semi-secrets"; + home-manager = { # User Package Management url = "github:nix-community/home-manager/master"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix index 00dbd81..99967e1 100644 --- a/hosts/desktop/default.nix +++ b/hosts/desktop/default.nix @@ -18,7 +18,7 @@ # └─ default.nix # -{ pkgs, lib, user, config, ... }: +{ inputs, pkgs, lib, user, config, location, ... }: { imports = # For now, if applying to other system, swap files @@ -68,7 +68,6 @@ environment = { # Packages installed system wide systemPackages = with pkgs; [ # This is because some options need to be configured. wacomtablet - xorg.xf86videoamdgpu ]; }; diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix index e2b9f5f..9375b77 100644 --- a/hosts/laptop/default.nix +++ b/hosts/laptop/default.nix @@ -16,7 +16,7 @@ # └─ default.nix # -{ config, pkgs, lib, user, ... }: +{ inputs, config, pkgs, lib, user, ... }: { imports = # For now, if applying to other system, swap files diff --git a/modules/services/syncthing.nix b/modules/services/syncthing.nix index 61aa017..1f450dd 100644 --- a/modules/services/syncthing.nix +++ b/modules/services/syncthing.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, user, ... }: +{ inputs, config, lib, pkgs, user, ... }: { networking.firewall = { diff --git a/modules/services/wireguard.nix b/modules/services/wireguard.nix index 50e8cc7..67458fd 100644 --- a/modules/services/wireguard.nix +++ b/modules/services/wireguard.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, user, ... }: +{ inputs, config, lib, pkgs, user, location, ... }: { networking.firewall = { @@ -7,7 +7,7 @@ networking = { nameservers = [ - "${inputs.semi-secrets.wg.lan.serverIp}" + inputs.semi-secrets.wg.lan.serverIp "1.1.1.1" "1.0.0.1" ]; @@ -31,10 +31,11 @@ peers = [ { publicKey = "Mui5wOV21QTer4NK2dUcBOgaW9UFzFzwmxOn/458ByI="; - endpoint = "${inputs.semi-secrets.wg.serverEndpoint}"; + endpoint = inputs.semi-secrets.wg.serverEndpoint; + # The ip is not refreshed, as the kernel cannot perform DNS resolution. Use dynamicEndpointRefreshSeconds, # in case the ip is refreshed often. If not, sync after refresh should be alright. - allowedIPs = [ "${inputs.semi-secrets.wg.allowedIp}" ]; + allowedIPs = [ inputs.semi-secrets.wg.allowedIp ]; persistentKeepalive = 25; } ]; -- 2.48.1