From 3ec72fc172f890765ca49cc28f75a39200daf3d9 Mon Sep 17 00:00:00 2001 From: Kristian Krsnik Date: Fri, 22 Sep 2023 22:13:46 +0200 Subject: [PATCH] changed structure to accommodate laptop --- {modules => common}/bash.nix | 0 home.nix => common/default.nix | 24 ++++++++++---------- {modules => common}/direnv.nix | 0 {modules => common}/firefox.nix | 0 {modules => common}/fonts.nix | 0 {modules => common}/git.nix | 0 {modules => common}/gnome.nix | 0 {modules => common}/gpg.nix | 0 {modules => common}/mpv.nix | 0 {modules => common}/nvim/cmp.lua | 0 {modules => common}/nvim/colors.lua | 0 {modules => common}/nvim/default.nix | 0 {modules => common}/nvim/fugitive.lua | 0 {modules => common}/nvim/keybinds.lua | 0 {modules => common}/nvim/lspconfig.lua | 0 {modules => common}/nvim/telescope.lua | 0 {modules => common}/nvim/treesitter.lua | 0 {modules => common}/nvim/undotree.lua | 0 {modules => common}/packages.nix | 4 ++++ {modules => common}/thunderbird.nix | 0 {modules => common}/vscode.nix | 0 flake.nix | 8 +++---- laptop.nix | 29 ------------------------- laptop/default.nix | 14 ++++++++++++ pc.nix => pc/default.nix | 12 ++-------- 25 files changed, 36 insertions(+), 55 deletions(-) rename {modules => common}/bash.nix (100%) rename home.nix => common/default.nix (73%) rename {modules => common}/direnv.nix (100%) rename {modules => common}/firefox.nix (100%) rename {modules => common}/fonts.nix (100%) rename {modules => common}/git.nix (100%) rename {modules => common}/gnome.nix (100%) rename {modules => common}/gpg.nix (100%) rename {modules => common}/mpv.nix (100%) rename {modules => common}/nvim/cmp.lua (100%) rename {modules => common}/nvim/colors.lua (100%) rename {modules => common}/nvim/default.nix (100%) rename {modules => common}/nvim/fugitive.lua (100%) rename {modules => common}/nvim/keybinds.lua (100%) rename {modules => common}/nvim/lspconfig.lua (100%) rename {modules => common}/nvim/telescope.lua (100%) rename {modules => common}/nvim/treesitter.lua (100%) rename {modules => common}/nvim/undotree.lua (100%) rename {modules => common}/packages.nix (94%) rename {modules => common}/thunderbird.nix (100%) rename {modules => common}/vscode.nix (100%) delete mode 100644 laptop.nix create mode 100644 laptop/default.nix rename pc.nix => pc/default.nix (73%) diff --git a/modules/bash.nix b/common/bash.nix similarity index 100% rename from modules/bash.nix rename to common/bash.nix diff --git a/home.nix b/common/default.nix similarity index 73% rename from home.nix rename to common/default.nix index 6055681..91a33bf 100644 --- a/home.nix +++ b/common/default.nix @@ -18,18 +18,18 @@ home.keyboard.layout = "at"; imports = [ - ./modules/bash.nix - ./modules/direnv.nix - ./modules/firefox.nix - ./modules/fonts.nix - ./modules/git.nix - ./modules/gnome.nix - ./modules/gpg.nix - ./modules/nvim - ./modules/packages.nix - ./modules/thunderbird.nix - ./modules/vscode.nix - ./modules/mpv.nix + ./bash.nix + ./direnv.nix + ./firefox.nix + ./fonts.nix + ./git.nix + ./gnome.nix + ./gpg.nix + ./nvim + ./packages.nix + ./thunderbird.nix + ./vscode.nix + ./mpv.nix ]; # Programs diff --git a/modules/direnv.nix b/common/direnv.nix similarity index 100% rename from modules/direnv.nix rename to common/direnv.nix diff --git a/modules/firefox.nix b/common/firefox.nix similarity index 100% rename from modules/firefox.nix rename to common/firefox.nix diff --git a/modules/fonts.nix b/common/fonts.nix similarity index 100% rename from modules/fonts.nix rename to common/fonts.nix diff --git a/modules/git.nix b/common/git.nix similarity index 100% rename from modules/git.nix rename to common/git.nix diff --git a/modules/gnome.nix b/common/gnome.nix similarity index 100% rename from modules/gnome.nix rename to common/gnome.nix diff --git a/modules/gpg.nix b/common/gpg.nix similarity index 100% rename from modules/gpg.nix rename to common/gpg.nix diff --git a/modules/mpv.nix b/common/mpv.nix similarity index 100% rename from modules/mpv.nix rename to common/mpv.nix diff --git a/modules/nvim/cmp.lua b/common/nvim/cmp.lua similarity index 100% rename from modules/nvim/cmp.lua rename to common/nvim/cmp.lua diff --git a/modules/nvim/colors.lua b/common/nvim/colors.lua similarity index 100% rename from modules/nvim/colors.lua rename to common/nvim/colors.lua diff --git a/modules/nvim/default.nix b/common/nvim/default.nix similarity index 100% rename from modules/nvim/default.nix rename to common/nvim/default.nix diff --git a/modules/nvim/fugitive.lua b/common/nvim/fugitive.lua similarity index 100% rename from modules/nvim/fugitive.lua rename to common/nvim/fugitive.lua diff --git a/modules/nvim/keybinds.lua b/common/nvim/keybinds.lua similarity index 100% rename from modules/nvim/keybinds.lua rename to common/nvim/keybinds.lua diff --git a/modules/nvim/lspconfig.lua b/common/nvim/lspconfig.lua similarity index 100% rename from modules/nvim/lspconfig.lua rename to common/nvim/lspconfig.lua diff --git a/modules/nvim/telescope.lua b/common/nvim/telescope.lua similarity index 100% rename from modules/nvim/telescope.lua rename to common/nvim/telescope.lua diff --git a/modules/nvim/treesitter.lua b/common/nvim/treesitter.lua similarity index 100% rename from modules/nvim/treesitter.lua rename to common/nvim/treesitter.lua diff --git a/modules/nvim/undotree.lua b/common/nvim/undotree.lua similarity index 100% rename from modules/nvim/undotree.lua rename to common/nvim/undotree.lua diff --git a/modules/packages.nix b/common/packages.nix similarity index 94% rename from modules/packages.nix rename to common/packages.nix index dafe25b..5bc9894 100644 --- a/modules/packages.nix +++ b/common/packages.nix @@ -26,6 +26,9 @@ xournalpp onlyoffice-bin + # Games + osu-lazer + # Communication webcord telegram-desktop @@ -34,6 +37,7 @@ # Creative software gimp + davinci-resolve # Misc comma # Run any binary from the repos with a comma `, cowsay neato` diff --git a/modules/thunderbird.nix b/common/thunderbird.nix similarity index 100% rename from modules/thunderbird.nix rename to common/thunderbird.nix diff --git a/modules/vscode.nix b/common/vscode.nix similarity index 100% rename from modules/vscode.nix rename to common/vscode.nix diff --git a/flake.nix b/flake.nix index 763feaf..156ba98 100644 --- a/flake.nix +++ b/flake.nix @@ -44,7 +44,7 @@ formatter.${system} = pkgs.alejandra; commonModules = [ - ./home.nix + ./common { _module.args.wallpaper = wallpaper.packages.${system}.default; @@ -77,12 +77,12 @@ ]; homeConfigurations = { - kristian = home-manager.lib.homeManagerConfiguration { + pc = home-manager.lib.homeManagerConfiguration { inherit pkgs; modules = [ - ./pc.nix + ./pc ] ++ self.commonModules; }; @@ -92,7 +92,7 @@ modules = [ - ./laptop.nix + ./laptop ] ++ self.commonModules; }; diff --git a/laptop.nix b/laptop.nix deleted file mode 100644 index 99c194b..0000000 --- a/laptop.nix +++ /dev/null @@ -1,29 +0,0 @@ -{pkgs, ...}: { - config.targets.genericLinux.enable = true; - - config.home.packages = with pkgs; [ - gnome-console - auto-cpufreq - ]; - - config.programs.bash.shellAliases = { - hms = "home-manager switch --flake $HOME/.config/home-manager#laptop"; - }; - - config.services = { - syncthing.enable = true; - }; - - # Changes specific to the laptop - config.dconf.settings = { - "org/gnome/settings-daemon/plugins/power" = { - sleep-inactive-ac-type = "nothing"; - power-button-action = "nothing"; - }; - }; - - config.nix = { - package = pkgs.nix; - settings.experimental-features = ["nix-command" "flakes"]; - }; -} diff --git a/laptop/default.nix b/laptop/default.nix new file mode 100644 index 0000000..6d956cf --- /dev/null +++ b/laptop/default.nix @@ -0,0 +1,14 @@ +{...}: { + config.targets.genericLinux.enable = false; + + config.programs.bash.shellAliases = { + hms = "home-manager switch --flake $HOME/.config/home-manager#laptop"; + }; + + config.dconf.settings = { + "org/gnome/settings-daemon/plugins/power" = { + sleep-inactive-ac-type = "suspend"; + power-button-action = "hibernate"; + }; + }; +} diff --git a/pc.nix b/pc/default.nix similarity index 73% rename from pc.nix rename to pc/default.nix index 0cc5812..7df1845 100644 --- a/pc.nix +++ b/pc/default.nix @@ -1,16 +1,8 @@ -{pkgs, ...}: { +{...}: { config.targets.genericLinux.enable = false; - # Changes specific to the PC - config.home.packages = with pkgs; [ - davinci-resolve - - # Games - osu-lazer - ]; - config.programs.bash.shellAliases = { - hms = "home-manager switch --flake $HOME/.config/home-manager"; + hms = "home-manager switch --flake $HOME/.config/home-manager#pc"; }; config.dconf.settings = {