From 3b29594b7987987d9653ae417b1f3f6261e5a701 Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Tue, 14 May 2024 13:34:05 -0400 Subject: [PATCH] prepared workstation --- src/system/machines/vm/system.nix | 6 -- src/system/machines/workstation/home.nix | 72 ++++++++++--------- .../workstation/scripts/guiControl.nix | 17 +++++ src/user/modules/bash/config/prompt.nix | 2 +- 4 files changed, 55 insertions(+), 42 deletions(-) create mode 100644 src/system/machines/workstation/scripts/guiControl.nix diff --git a/src/system/machines/vm/system.nix b/src/system/machines/vm/system.nix index a29f208..1d10ff5 100644 --- a/src/system/machines/vm/system.nix +++ b/src/system/machines/vm/system.nix @@ -4,12 +4,6 @@ imports = [ ../../modules ]; - modules = { - system = { - bitcoin.enable = true; - }; - }; - users.users = { ${config.user.name} = { isNormalUser = true; diff --git a/src/system/machines/workstation/home.nix b/src/system/machines/workstation/home.nix index b4d6156..4c63bb8 100644 --- a/src/system/machines/workstation/home.nix +++ b/src/system/machines/workstation/home.nix @@ -7,43 +7,45 @@ stateVersion = "23.11"; username = "${config.user.name}"; homeDirectory = "/home/${config.user.name}"; + programs.home-manager.enable = true; - file.".config/home-manager" = { - source = ../../../..; - recursive = true; - }; - }; - - programs.home-manager.enable = true; - programs.bash.shellAliases = { - #nixup = "home-manager switch --flake"; - }; - - nix = { - package = pkgs.nixFlakes; - extraOptions = "experimental-features = nix-command flakes"; - settings = { - auto-optimise-store = true; - trusted-users = [ "${config.user.name}" ]; - }; - }; - modules = { - user = { - bash.enable = true; - git.enable = true; - gpg.enable = true; - security.enable = false; - gui = { - alacritty.enable = true; - browsers.enable = true; - neovim.enable = true; + programs.bash = { + shellAliases = { + nixup = "home-manager switch --flake"; }; - utils = { - enable = true; - dev.enable = true; - email.enable = true; - irc.enable = true; - vim.enable = true; + initExtra = + import ./scripts/guiControl + ; + }; + + nix = { + package = pkgs.nixFlakes; + extraOptions = "experimental-features = nix-command flakes"; + settings = { + auto-optimise-store = true; + trusted-users = [ "${config.user.name}" ]; + }; + }; + + modules = { + user = { + bash.enable = true; + git.enable = true; + gpg.enable = true; + security.enable = false; + gui = { + sway.enable = true; + alacritty.enable = true; + browsers.enable = true; + neovim.enable = true; + }; + utils = { + enable = true; + dev.enable = true; + email.enable = true; + irc.enable = true; + vim.enable = true; + }; }; }; }; diff --git a/src/system/machines/workstation/scripts/guiControl.nix b/src/system/machines/workstation/scripts/guiControl.nix new file mode 100644 index 0000000..2e0f534 --- /dev/null +++ b/src/system/machines/workstation/scripts/guiControl.nix @@ -0,0 +1,17 @@ +'' +function nome() { + case $1 in + on) + sudo systemctl set-default graphical.target + sudo systemctl start graphical.target + ;; + off) + sudo systemctl set-default multi-user.target + sudo systemctl isolate multi-user.target + ;; + *) + echo "Usage: $0 {on|off}" + ;; + esac +} +'' diff --git a/src/user/modules/bash/config/prompt.nix b/src/user/modules/bash/config/prompt.nix index a095a35..86fb914 100644 --- a/src/user/modules/bash/config/prompt.nix +++ b/src/user/modules/bash/config/prompt.nix @@ -3,7 +3,7 @@ with lib; let git = config.modules.user.git; - gui = config.modules.user.gui.sway; + gui = config.modules.user.gui.alacritty; in ''