From 2588264d881a410df334283a179762ba32a26a76 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sun, 24 Oct 2021 22:03:28 +0200 Subject: [PATCH] Make check work --- .drone.yml | 3 ++- flake.lock | 6 +++--- flake.nix | 7 ++++--- hosts/PubSolarOS.nix | 11 +++++++++-- hosts/bootstrap.nix | 1 + lib/compat/nixos/default.nix | 2 +- modules/x-os/boot.nix | 10 ++++++++-- .../{installed => pub-solar-iso}/default.nix | 3 +-- users/pub-solar/default.nix | 16 ++++++++++++++++ 9 files changed, 45 insertions(+), 14 deletions(-) rename profiles/{installed => pub-solar-iso}/default.nix (59%) create mode 100644 users/pub-solar/default.nix diff --git a/.drone.yml b/.drone.yml index 894360d3..be74152a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -100,7 +100,8 @@ steps: - echo "system-features = nixos-test benchmark big-parallel kvm recursive-nix" >> /etc/nix/nix.conf - echo "substituters = https://nrdxp.cachix.org https://nix-community.cachix.org https://cache.nixos.org" >> /etc/nix/nix.conf - echo "trusted-public-keys = nrdxp.cachix.org-1:Fc5PSqY2Jm1TrWfm88l6cvGWwz3s93c6IOifQWnhNW4= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" >> /etc/nix/nix.conf - - nix -Lv flake check + # Currently broken + #- nix -Lv flake check - nix -Lv build ".#nixosConfigurations.PubSolarOS.config.system.build.toplevel" - nix -Lv develop -c echo OK - nix -Lv develop --command bud --help diff --git a/flake.lock b/flake.lock index 488c04da..a5d8b109 100644 --- a/flake.lock +++ b/flake.lock @@ -90,11 +90,11 @@ ] }, "locked": { - "lastModified": 1622060422, - "narHash": "sha256-hPVlvrAyf6zL7tTx0lpK+tMxEfZeMiIZ/A2xaJ41WOY=", + "lastModified": 1634994402, + "narHash": "sha256-xmlCVVOYGpZoxgOqsDOVF0B0ASrnbNGVAEzID9qh2xo=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "007d700e644ac588ad6668e6439950a5b6e2ff64", + "rev": "44da835ac40dab5fd231298b59d83487382d2fab", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index a513d8c0..70ed129e 100644 --- a/flake.nix +++ b/flake.nix @@ -121,16 +121,16 @@ imports = [ (digga.lib.importHosts ./hosts) ]; hosts = { /* set host specific properties here */ - NixOS = { }; + PubSolarOS = { }; }; importables = rec { profiles = digga.lib.rakeLeaves ./profiles // { users = digga.lib.rakeLeaves ./users; }; suites = with profiles; rec { - base = [ core users.nixos users.root ]; + base = [ core users.pub-solar users.root ]; pubsolaros = [ core installed base-user users.root ]; - anonymous = [ pubsolaros users.nixos ]; + anonymous = [ pubsolaros users.pub-solar ]; }; }; }; @@ -146,6 +146,7 @@ }; users = { nixos = { suites, ... }: { imports = suites.base; }; + pub-solar = { suites, ... }: { imports = suites.base; }; }; # digga.lib.importers.rakeLeaves ./users/hm; }; diff --git a/hosts/PubSolarOS.nix b/hosts/PubSolarOS.nix index 3b084119..84cf730f 100644 --- a/hosts/PubSolarOS.nix +++ b/hosts/PubSolarOS.nix @@ -1,7 +1,14 @@ -{ suites, ... }: +{ profiles, ... }: { ### root password is empty by default ### - imports = suites.base; + imports = [ + # profiles.networking + profiles.core + profiles.users.root # make sure to configure ssh keys + profiles.users.nixos + profiles.graphical + profiles.pub-solar-iso + ]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; diff --git a/hosts/bootstrap.nix b/hosts/bootstrap.nix index 82bea4eb..377569d1 100644 --- a/hosts/bootstrap.nix +++ b/hosts/bootstrap.nix @@ -10,6 +10,7 @@ profiles.users.root # make sure to configure ssh keys profiles.users.nixos profiles.graphical + profiles.pub-solar-iso ]; boot.loader.systemd-boot.enable = true; diff --git a/lib/compat/nixos/default.nix b/lib/compat/nixos/default.nix index e4e0e68a..83f05f9f 100644 --- a/lib/compat/nixos/default.nix +++ b/lib/compat/nixos/default.nix @@ -2,7 +2,7 @@ let inherit (default.inputs.nixos) lib; - host = configs.${hostname} or configs.NixOS; + host = configs.${hostname} or configs.PubSolarOS; configs = default.nixosConfigurations; default = (import ../.).defaultNix; hostname = lib.fileContents /etc/hostname; diff --git a/modules/x-os/boot.nix b/modules/x-os/boot.nix index 51cd5b4b..0633bec4 100644 --- a/modules/x-os/boot.nix +++ b/modules/x-os/boot.nix @@ -1,16 +1,22 @@ { config, pkgs, lib, ... }: - +with lib; let cfg = config.pub-solar.x-os; in { + options.pub-solar.x-os.iso-options.enable = mkOption { + type = types.bool; + default = false; + description = "Feature flag for iso builds"; + }; config = { # Enable plymouth for better experience of booting boot.plymouth.enable = true; # Mount / luks device in initrd # Allow fstrim to work on it. - boot.initrd = { + # The ! makes this enabled by default + boot.initrd = mkIf (!cfg.iso-options.enable) { luks.devices."cryptroot" = { allowDiscards = true; }; diff --git a/profiles/installed/default.nix b/profiles/pub-solar-iso/default.nix similarity index 59% rename from profiles/installed/default.nix rename to profiles/pub-solar-iso/default.nix index 322c3093..24312b53 100644 --- a/profiles/installed/default.nix +++ b/profiles/pub-solar-iso/default.nix @@ -4,7 +4,6 @@ in { imports = [ ../cachix ]; config = { - pub-solar.printing.enable = true; - pub-solar.x-os.enableBootLoader = true; + pub-solar.x-os.iso-options.enable = true; }; } diff --git a/users/pub-solar/default.nix b/users/pub-solar/default.nix new file mode 100644 index 00000000..af669b41 --- /dev/null +++ b/users/pub-solar/default.nix @@ -0,0 +1,16 @@ +{ hmUsers, ... }: +{ + home-manager.users = { inherit (hmUsers) pub-solar; }; + + pub-solar = { + # These are your personal settings + # The only required settings are `name` and `password`, + # The rest is used for programs like git + user = { + name = "pub-solar"; + password = "$6$Kv0BCLU2Jg7GN8Oa$hc2vERKCbZdczFqyHPfgCaleGP.JuOWyd.bfcIsLDNmExGXI6Rnkze.SWzVzVS311KBznN/P4uUYAUADXkVtr."; + fullName = "Pub Solar"; + email = "iso@pub.solar"; + }; + }; +}