From b673b76f41a1f48c38acb9b67657e097e5b8a61f Mon Sep 17 00:00:00 2001 From: seth Date: Fri, 2 Dec 2022 02:12:40 -0500 Subject: now *most* things work :p --- hosts/common/default.nix | 6 ++++++ hosts/common/security.nix | 17 +++++++++++++++++ hosts/common/users.nix | 18 ++++++++++++++++++ hosts/glados-wsl/config.nix | 22 ++++++++++++++++++++++ hosts/glados-wsl/default.nix | 19 +++++++++++++++++++ hosts/glados-wsl/packages.nix | 11 +++++++++++ hosts/glados/config.nix | 22 ---------------------- hosts/glados/default.nix | 8 -------- hosts/glados/packages.nix | 10 ---------- hosts/glados/security.nix | 17 ----------------- hosts/glados/users.nix | 27 --------------------------- 11 files changed, 93 insertions(+), 84 deletions(-) create mode 100644 hosts/common/default.nix create mode 100644 hosts/common/security.nix create mode 100644 hosts/common/users.nix create mode 100644 hosts/glados-wsl/config.nix create mode 100644 hosts/glados-wsl/default.nix create mode 100644 hosts/glados-wsl/packages.nix delete mode 100644 hosts/glados/config.nix delete mode 100644 hosts/glados/default.nix delete mode 100644 hosts/glados/packages.nix delete mode 100644 hosts/glados/security.nix delete mode 100644 hosts/glados/users.nix (limited to 'hosts') diff --git a/hosts/common/default.nix b/hosts/common/default.nix new file mode 100644 index 0000000..32dad83 --- /dev/null +++ b/hosts/common/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./security.nix + ./users.nix + ]; +} diff --git a/hosts/common/security.nix b/hosts/common/security.nix new file mode 100644 index 0000000..debd6b7 --- /dev/null +++ b/hosts/common/security.nix @@ -0,0 +1,17 @@ +{ lib, config, ... }: + +with builtins; with lib; +{ + security.sudo = { + configFile = '' + Defaults env_reset + Defaults secure_path = /run/wrappers/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin + Defaults editor = /run/current-system/sw/bin/vim,!env_editor + ''; + execWheelOnly = true; + extraRules = [ + { users = [ "root" ]; groups = [ "root" ]; commands = [ "ALL" ]; } + { users = [ "seth" ]; commands = [ "ALL" ]; } + ]; + }; +} diff --git a/hosts/common/users.nix b/hosts/common/users.nix new file mode 100644 index 0000000..1dd219e --- /dev/null +++ b/hosts/common/users.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +with config; with lib; with pkgs; +{ + users = { + defaultUserShell = bash; + mutableUsers = false; + + users = { + + root = { + home = "/root"; + uid = ids.uids.root; + group = "root"; + initialHashedPassword = mkDefault "!"; + }; + +} diff --git a/hosts/glados-wsl/config.nix b/hosts/glados-wsl/config.nix new file mode 100644 index 0000000..7a649af --- /dev/null +++ b/hosts/glados-wsl/config.nix @@ -0,0 +1,22 @@ +{ config, pkgs, ...}: + +{ + # hardware = { + # nvidia.package = boot.kernelPackages.nvidiaPackages.stable; + # xserver = { + # videoDrivers = [ "nvidia" ]; + # }; + # opengl.enable = true; + # }; + + networking.hostName = "glados-wsl"; + + programs = { + gnupg = { + agent = { + enable = true; + pinentryFlavor = "curses"; + }; + }; + }; +} diff --git a/hosts/glados-wsl/default.nix b/hosts/glados-wsl/default.nix new file mode 100644 index 0000000..2846100 --- /dev/null +++ b/hosts/glados-wsl/default.nix @@ -0,0 +1,19 @@ +{ config, modulesPath, pkgs, ...}: + +{ + imports = [ + (modulesPath + "/profiles/minimal.nix") + ./config.nix + ./packages.nix + ../../users/seth + ]; + + # enable non-free packages + nixpkgs.config.allowUnfree = true; + + # Enable nix flakes + nix.package = pkgs.nixFlakes; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + system.stateVersion = "22.11"; +} diff --git a/hosts/glados-wsl/packages.nix b/hosts/glados-wsl/packages.nix new file mode 100644 index 0000000..bfca6df --- /dev/null +++ b/hosts/glados-wsl/packages.nix @@ -0,0 +1,11 @@ +{ confg, pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + git + neofetch + nixos-option + python310 + vim + ]; +} diff --git a/hosts/glados/config.nix b/hosts/glados/config.nix deleted file mode 100644 index 819a4f4..0000000 --- a/hosts/glados/config.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ config, pkgs, ...}: - -{ - # hardware = { - # nvidia.package = boot.kernelPackages.nvidiaPackages.stable; - # xserver = { - # videoDrivers = [ "nvidia" ]; - # }; - # opengl.enable = true; - # }; - - networking.hostName = "glados"; - - programs = { - gnupg = { - agent = { - enable = true; - pinentryFlavor = "curses"; - }; - }; - }; -} diff --git a/hosts/glados/default.nix b/hosts/glados/default.nix deleted file mode 100644 index 8f9a315..0000000 --- a/hosts/glados/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - imports = [ - ./config.nix - ./packages.nix - ./security.nix - ./users.nix - ]; -} diff --git a/hosts/glados/packages.nix b/hosts/glados/packages.nix deleted file mode 100644 index 63de591..0000000 --- a/hosts/glados/packages.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ confg, pkgs, ... }: - -{ - environment.systemPackages = with pkgs; [ - neofetch - nixos-option - python310 - vim - ]; -} diff --git a/hosts/glados/security.nix b/hosts/glados/security.nix deleted file mode 100644 index debd6b7..0000000 --- a/hosts/glados/security.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ lib, config, ... }: - -with builtins; with lib; -{ - security.sudo = { - configFile = '' - Defaults env_reset - Defaults secure_path = /run/wrappers/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin - Defaults editor = /run/current-system/sw/bin/vim,!env_editor - ''; - execWheelOnly = true; - extraRules = [ - { users = [ "root" ]; groups = [ "root" ]; commands = [ "ALL" ]; } - { users = [ "seth" ]; commands = [ "ALL" ]; } - ]; - }; -} diff --git a/hosts/glados/users.nix b/hosts/glados/users.nix deleted file mode 100644 index e0b04c5..0000000 --- a/hosts/glados/users.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ config, lib, pkgs, ... }: - -with config; with lib; with pkgs; -{ - users = { - defaultUserShell = bash; - mutableUsers = false; - - users = { - - root = { - home = "/root"; - uid = ids.uids.root; - group = "root"; - initialHashedPassword = mkDefault "!"; - }; - - seth = { - extraGroups = [ "wheel" ]; - isNormalUser = true; - hashedPassword = "idontknowhowtosecurethis"; - shell = fish; - }; - - }; - }; -} -- cgit v1.2.3