From 4ad872e626ca42a2d848c2ef80762575375f0672 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 6 Oct 2023 00:49:19 -0500 Subject: [PATCH] Add homeconfig bases --- flake.nix | 19 +++++++++----- modules/home-manager/default.nix | 3 +++ modules/home-manager/dragon.nix | 44 ++++++++++++++++++++++++++++++++ modules/home-manager/macos.nix | 7 ++++- modules/home-manager/sway.nix | 23 ++++++++++++----- modules/home-manager/thinker.nix | 10 ++++++++ 6 files changed, 92 insertions(+), 14 deletions(-) create mode 100644 modules/home-manager/dragon.nix create mode 100644 modules/home-manager/thinker.nix diff --git a/flake.nix b/flake.nix index fda83e4..fa963af 100644 --- a/flake.nix +++ b/flake.nix @@ -28,7 +28,7 @@ } @ inputs: let inherit (self) outputs; - forAllSystems = nixpkgs-stable.lib.genAttrs [ + systems = [ "aarch64-linux" # "i686-linux" "x86_64-linux" @@ -36,6 +36,8 @@ "x86_64-darwin" ]; + forAllSystems = nixpkgs-stable.lib.genAttrs systems; + color-schemes = (import ./lib/colors.nix inputs).schemes; colors = color-schemes.catppuccin-mocha-sapphire; # colors = (import ./lib/colors.nix inputs).color-schemes.donokai; @@ -96,10 +98,10 @@ mkNixosUnstableSystem = mkNixosSystem nixpkgs-unstable.lib.nixosSystem; in { dragon = mkNixosUnstableSystem "x86_64-linux" [./nixos/dragon] (with outputs.homeManagerModules; [ - sway + dragon ]); thinker = mkNixosUnstableSystem "x86_64-linux" [./nixos/thinker] (with outputs.homeManagerModules; [ - sway + thinker ]); beefcake = mkNixosUnstableSystem "x86_64-linux" [ @@ -119,14 +121,19 @@ # Standalone home-manager configuration entrypoint # Available through 'home-manager --flake .#your-username@your-hostname' homeConfigurations = { - /* - daniel = home-manager.lib.homeManagerConfiguration rec { + # TODO: non-system-specific home configurations? + "base-x86_64-linux" = home-manager.lib.homeManagerConfiguration rec { system = "x86_64-linux"; pkgs = nixpkgs-unstable.legacyPackages.${system}; extraSpecialArgs = {inherit inputs outputs system colors font;}; modules = with outputs.homeManagerModules; [linux]; }; - */ + "base-aarch64-darwin" = home-manager.lib.homeManagerConfiguration rec { + system = "aarch64-darwin"; + pkgs = nixpkgs-unstable.legacyPackages.${system}; + extraSpecialArgs = {inherit inputs outputs system colors font;}; + modules = with outputs.homeManagerModules; [macos]; + }; }; # TODO: nix-on-droid for phone terminal usage? diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 89fda1b..9463aab 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -21,4 +21,7 @@ swaylock = import ./swaylock.nix; desktop = import ./desktop.nix; sway = import ./sway.nix; + + dragon = import ./dragon.nix; + thinker = import ./thinker.nix; } diff --git a/modules/home-manager/dragon.nix b/modules/home-manager/dragon.nix new file mode 100644 index 0000000..e518a9a --- /dev/null +++ b/modules/home-manager/dragon.nix @@ -0,0 +1,44 @@ +{ + lib, + outputs, + ... +}: { + imports = with outputs.homeManagerModules; [ + sway + ]; + + wayland.windowManager.sway = { + config = { + output = { + "GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307" = { + mode = "3840x2160@120Hz"; + }; + + "Dell Inc. DELL U2720Q D3TM623" = { + # desktop left vertical monitor + mode = "3840x2160@60Hz"; + transform = "90"; + scale = "1.5"; + }; + }; + + workspaceOutputAssign = + ( + map + (ws: { + output = "GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307"; + workspace = toString ws; + }) + (lib.range 1 7) + ) + ++ ( + map + (ws: { + output = "Dell Inc. DELL U2720Q D3TM623"; + workspace = toString ws; + }) + (lib.range 8 9) + ); + }; + }; +} diff --git a/modules/home-manager/macos.nix b/modules/home-manager/macos.nix index 6462967..fa36e52 100644 --- a/modules/home-manager/macos.nix +++ b/modules/home-manager/macos.nix @@ -1 +1,6 @@ -{...}: {} +{outputs, ...}: { + imports = with outputs.homeManagerModules; [ + common + desktop + ]; +} diff --git a/modules/home-manager/sway.nix b/modules/home-manager/sway.nix index a255e90..c833ad5 100644 --- a/modules/home-manager/sway.nix +++ b/modules/home-manager/sway.nix @@ -47,22 +47,31 @@ enable = true; }; + extraConfig = '' + exec --no-startup-id { + swaymsg "workspace 1" + } + ''; config = { + defaultWorkspace = "1"; + + workspaceOutputAssign = [ + /* + { + output = "eDP"; + workspace = "1"; + */ + ]; + output = { "*" = { background = "$HOME/.wallpaper fill"; }; - - "Dell Inc. DELL U2720Q D3TM623" = { - # desktop left vertical monitor - transform = "90"; - scale = "1.5"; - }; }; # TODO: popup_during_fullscreen smart focus = { - wrapping = "no"; + wrapping = "no"; # maybe workspace? followMouse = "no"; mouseWarping = false; }; diff --git a/modules/home-manager/thinker.nix b/modules/home-manager/thinker.nix new file mode 100644 index 0000000..7e53e6f --- /dev/null +++ b/modules/home-manager/thinker.nix @@ -0,0 +1,10 @@ +{outputs, ...}: { + imports = with outputs.homeManagerModules; [ + sway + ]; + + wayland.windowManager.sway = { + # TODO: firefox initial open on workspace 2 + # TODO: kitty initial open on workspace 1 + }; +}