From 6113c8891e700be0953890c2d8df8357a66daa20 Mon Sep 17 00:00:00 2001 From: Kristian Krsnik Date: Sun, 27 Aug 2023 21:17:36 +0200 Subject: [PATCH] seperated main PC and Laptop without NixOS --- flake.nix | 72 +++++++++++++++++++++++++++----------------- home.nix | 3 -- laptop.nix | 11 +++++++ modules/gnome.nix | 5 --- modules/packages.nix | 4 --- pc.nix | 18 +++++++++++ 6 files changed, 74 insertions(+), 39 deletions(-) create mode 100644 laptop.nix create mode 100644 pc.nix diff --git a/flake.nix b/flake.nix index b31f665..9549881 100644 --- a/flake.nix +++ b/flake.nix @@ -36,39 +36,57 @@ in { formatter.${system} = pkgs.alejandra; + commonModules = [ + ./home.nix + + { + _module.args.wallpaper = wallpaper.packages.${system}.default; + } + + nur.nixosModules.nur + + { + nixpkgs.overlays = [ + zig.overlays.default # Add zig + ( # https://github.com/nix-community/home-manager/issues/1538#issuecomment-706627100 + final: prev: { + unstable = import nixpkgs-unstable { + system = final.system; + config.allowUnfreePredicate = _: true; + }; + master = import nixpkgs-master { + system = final.system; + config.allowUnfreePredicate = _: true; + }; + } + ) + ( # Overrides davinci-resolve with the unstable version because of https://github.com/NixOS/nixpkgs/pull/246074 + final: prev: {davinci-resolve = final.master.davinci-resolve;} + ) + ]; + } + ]; + homeConfigurations = { kristian = home-manager.lib.homeManagerConfiguration { inherit pkgs; - modules = [ - ./home.nix - { - _module.args.wallpaper = wallpaper.packages.${system}.default; - } + modules = + [ + ./pc.nix + ] + ++ self.commonModules; + }; - nur.nixosModules.nur + laptop = home-manager.lib.homeManagerConfiguration { + inherit pkgs; - { - nixpkgs.overlays = [ - zig.overlays.default # Add zig - ( # https://github.com/nix-community/home-manager/issues/1538#issuecomment-706627100 - final: prev: { - unstable = import nixpkgs-unstable { - system = final.system; - config.allowUnfreePredicate = _: true; - }; - master = import nixpkgs-master { - system = final.system; - config.allowUnfreePredicate = _: true; - }; - } - ) - ( # Overrides davinci-resolve with the unstable version because of https://github.com/NixOS/nixpkgs/pull/246074 - final: prev: {davinci-resolve = final.master.davinci-resolve;} - ) - ]; - } - ]; + modules = + self.commonModules + ++ [ + ./laptop.nix + ] + ++ self.commonModules; }; }; }; diff --git a/home.nix b/home.nix index 3dadab0..c25e56b 100644 --- a/home.nix +++ b/home.nix @@ -17,9 +17,6 @@ # Keyboard Layout home.keyboard.layout = "at"; - # TODO Change for Laptop - targets.genericLinux.enable = false; # Enable on non-nixos ditros - imports = [ ./modules/bash.nix ./modules/direnv.nix diff --git a/laptop.nix b/laptop.nix new file mode 100644 index 0000000..e9b4b2d --- /dev/null +++ b/laptop.nix @@ -0,0 +1,11 @@ +{...}: { + config.targets.genericLinux.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"; + }; + }; +} diff --git a/modules/gnome.nix b/modules/gnome.nix index 778cf6c..85d7dae 100644 --- a/modules/gnome.nix +++ b/modules/gnome.nix @@ -73,11 +73,6 @@ ]; }; - "org/gnome/settings-daemon/plugins/power" = { - sleep-inactive-ac-type = "nothing"; # Automatic suspend/hibernation creates a suspend/hibernation loop - power-button-action = "suspend"; - }; - "org/gnome/mutter" = { edge-tiling = true; dynamic-workspaces = true; diff --git a/modules/packages.nix b/modules/packages.nix index 7bb3a3e..06138ab 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -34,10 +34,6 @@ # Creative software gimp - davinci-resolve - - # Games - osu-lazer # Misc comma # Run any binary from the repos with a comma `, cowsay neato` diff --git a/pc.nix b/pc.nix new file mode 100644 index 0000000..8da81db --- /dev/null +++ b/pc.nix @@ -0,0 +1,18 @@ +{pkgs, ...}: { + config.targets.genericLinux.enable = false; + + # Changes specific to the PC + config.home.packages = with pkgs; [ + davinci-resolve + + # Games + osu-lazer + ]; + + config.dconf.settings = { + "org/gnome/settings-daemon/plugins/power" = { + sleep-inactive-ac-type = "nothing"; # Automatic suspend/hibernation creates a suspend/hibernation loop + power-button-action = "suspend"; + }; + }; +}