From 0432bb06fc8644f5632474bfdb860570a500ee53 Mon Sep 17 00:00:00 2001 From: Quentin Boyer Date: Tue, 22 Jun 2021 16:37:54 +0200 Subject: [PATCH] wireguard, gc, not flakes --- nixos/.gitignore | 1 + nixos/configuration.nix | 1 + nixos/localcfg.nix | 25 +++++++++++++++++++++++++ nixos/pkg.nix | 9 ++++++--- 4 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 nixos/.gitignore diff --git a/nixos/.gitignore b/nixos/.gitignore new file mode 100644 index 0000000..4d93d22 --- /dev/null +++ b/nixos/.gitignore @@ -0,0 +1 @@ +sensitive.nix diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 5d59dc8..70103ee 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -48,6 +48,7 @@ nix.autoOptimiseStore = true; nix.gc = { automatic = true; + dates = "weekly"; options = "--delete-older-than 7d"; # Ajuste comme tu veux, tu peux utiliser +5 pour garder les 5 dernières, etc. }; diff --git a/nixos/localcfg.nix b/nixos/localcfg.nix index 453dcba..f29fcbd 100644 --- a/nixos/localcfg.nix +++ b/nixos/localcfg.nix @@ -1,5 +1,8 @@ { config, pkgs, ... }: +let + sensitiveInfo = (import ./sensitive.nix); +in { boot = { initrd = { @@ -38,6 +41,21 @@ eno0.useDHCP = true; wlp1s0.useDHCP = true; }; + wireguard.interfaces = { + octopi = { + ips = [ "10.42.42.4/32" ]; + privateKeyFile = "/etc/wireguard/zelaptop.key"; + peers = [ + { + publicKey = sensitiveInfo.octopiPubKey; + presharedKeyFile = "/etc/wireguard/octopi-laptop.psk"; + allowedIPs = [ "10.42.42.1/32" ]; + endpoint = "${sensitiveInfo.homeUrl}:51820"; + persistentKeepalive = 25; + } + ]; + }; + }; }; users.users.traxys = { @@ -58,3 +76,10 @@ + + + + + + + diff --git a/nixos/pkg.nix b/nixos/pkg.nix index 7b1fddf..46056bc 100644 --- a/nixos/pkg.nix +++ b/nixos/pkg.nix @@ -12,12 +12,15 @@ }; }; - nixpkgs.config = { - package = pkgs.nixFlakes; - allowUnfree = true; + /* nix = { + package = pkgs.nixUnstable; extraOptions = '' experimental-features = nix-command flakes ''; + }; */ + + nixpkgs.config = { + allowUnfree = true; }; nixpkgs.overlays = [