From fd720fbe4d284d0562ab32e7bb6a3f7171992c21 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Sun, 23 Feb 2020 22:28:02 +0000 Subject: [PATCH] Nest configuration beneath socrates directory Create a socrates directory to store configuration for socrates. --- nixos/{configuration.nix => socrates/default.nix} | 11 +++-------- nixos/{ => socrates}/hardware.nix | 0 nixos/{ => socrates}/rebuild.nix | 4 ++-- 3 files changed, 5 insertions(+), 10 deletions(-) rename nixos/{configuration.nix => socrates/default.nix} (96%) rename nixos/{ => socrates}/hardware.nix (100%) rename nixos/{ => socrates}/rebuild.nix (65%) diff --git a/nixos/configuration.nix b/nixos/socrates/default.nix similarity index 96% rename from nixos/configuration.nix rename to nixos/socrates/default.nix index 54fd8f3ea..1692ac356 100644 --- a/nixos/configuration.nix +++ b/nixos/socrates/default.nix @@ -1,13 +1,9 @@ -{ - pkgs ? import {}, - briefcase ? import {}, - ... -}: +{ pkgs, briefcase, ... }: let trimNewline = x: pkgs.lib.removeSuffix "\n" x; readSecret = x: trimNewline (builtins.readFile ("/etc/secrets/" + x)); -in { +in pkgs.lib.fix(self: { imports = [ ./hardware.nix ]; # Use the systemd-boot EFI boot loader. @@ -68,7 +64,6 @@ in { "nixpkgs=/home/wpcarro/nixpkgs" ]; - # Allow wpcarro to call nixos-rebuild trustedUsers = [ "root" "wpcarro" ]; }; @@ -153,4 +148,4 @@ in { }; system.stateVersion = "20.09"; # Did you read the comment? -} +}) diff --git a/nixos/hardware.nix b/nixos/socrates/hardware.nix similarity index 100% rename from nixos/hardware.nix rename to nixos/socrates/hardware.nix diff --git a/nixos/rebuild.nix b/nixos/socrates/rebuild.nix similarity index 65% rename from nixos/rebuild.nix rename to nixos/socrates/rebuild.nix index 57c3e71f9..e6d885f97 100644 --- a/nixos/rebuild.nix +++ b/nixos/socrates/rebuild.nix @@ -1,9 +1,9 @@ -{ pkgs ? import {}, ... }: +{ pkgs, ... }: pkgs.writeShellScriptBin "rebuild" '' set -ue sudo nixos-rebuild \ - -I nixos-config=/home/wpcarro/briefcase/nixos/configuration.nix \ + -I nixos-config=/home/wpcarro/briefcase/nixos/socrates/default.nix \ -I nixpkgs=/home/wpcarro/nixpkgs \ -I depot=/home/wpcarro/depot \ -I briefcase=/home/wpcarro/briefcase \