home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 202ba44fe3e1535f27dd9dd88d488c21a3d20739
parent 4882d2e650ed17fbb1b89723bd2dca1f862be299
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Mon, 25 May 2020 17:31:22 +0200

profiles.home: migrate home.nixos.nix

- Make it a profile that can be enabled
- Use /home/build as a "detection" of "being in CI"

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Mmodules/module-list.nixos.nix | 3++-
Amodules/profiles/home.nixos.nix | 41+++++++++++++++++++++++++++++++++++++++++
Msystems/hokkaido.nix | 5+++--
Msystems/wakasu.nix | 2++
4 files changed, 48 insertions(+), 3 deletions(-)

diff --git a/modules/module-list.nixos.nix b/modules/module-list.nixos.nix @@ -5,13 +5,14 @@ ./profiles/avahi.nixos.nix ./profiles/base.nixos.nix ./profiles/buildkit.nixos.nix - ./profiles/fish.nixos.nix ./profiles/containerd.nixos.nix ./profiles/desktop.nixos.nix ./profiles/dev.nixos.nix ./profiles/docker.nixos.nix + ./profiles/fish.nixos.nix ./profiles/gaming.nixos.nix ./profiles/git.nixos.nix + ./profiles/home.nixos.nix ./profiles/i18n.nixos.nix ./profiles/ipfs.nixos.nix ./profiles/laptop.nixos.nix diff --git a/modules/profiles/home.nixos.nix b/modules/profiles/home.nixos.nix @@ -0,0 +1,41 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.profiles.home; + machines = import ../../assets/machines.nix; + home = machines.home; +in +{ + options = { + profiles.home = mkEnableOption "Enable home profile"; + }; + config = mkIf cfg { + boot.kernelParams = [ "nfs.nfs4_disable_idmapping=0" "nfsd.nfs4_disable_idmapping=0" ]; + networking.domain = "home"; + time.timeZone = "Europe/Paris"; + # To mimic autofs on fedora + fileSystems."/net/synodine.home/" = { + device = "${home.ips.synodine}:/"; + fsType = "nfs"; + options = [ "x-systemd.automount" "noauto" ]; + }; + # FIXME(vdemeester): I think it acts like this because there is only one export + fileSystems."/net/sakhalin.home/export/" = { + device = "${home.ips.sakhalin}:/"; + fsType = "nfs"; + options = [ "x-systemd.automount" "noauto" ]; + }; + # Deprecated + fileSystems."/mnt/synodine" = { + device = "${home.ips.synodine}:/"; + fsType = "nfs"; + options = [ "x-systemd.automount" "noauto" ]; + }; + fileSystems."/mnt/sakhalin" = { + device = "${home.ips.sakhalin}:/"; + fsType = "nfs"; + options = [ "x-systemd.automount" "noauto" ]; + }; + }; +} diff --git a/systems/hokkaido.nix b/systems/hokkaido.nix @@ -4,6 +4,7 @@ let # assert builtins.trace "This is a dummy config, use switch!" false; {} ''; + inCi = builtins.pathExists /home/build; in { imports = [ @@ -11,10 +12,10 @@ in ../modules/module-list.nixos.nix # hardware ../hardware/thinkpad-x220.nix - # FIXME: remove this - ../machines/home.nixos.nix ]; + profiles.home = !inCi; + networking = { hostName = "hokkaido"; }; diff --git a/systems/wakasu.nix b/systems/wakasu.nix @@ -15,6 +15,8 @@ in ../machines/home.nixos.nix ]; + profiles.home = !inCi; + networking = { hostName = "wakasu"; };