seperated main PC and Laptop without NixOS

This commit is contained in:
Kristian Krsnik 2023-08-27 21:17:36 +02:00
parent 49a621b985
commit 6113c8891e
6 changed files with 74 additions and 39 deletions

View File

@ -36,39 +36,57 @@
in { in {
formatter.${system} = pkgs.alejandra; 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 = { homeConfigurations = {
kristian = home-manager.lib.homeManagerConfiguration { kristian = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
modules = [ modules =
./home.nix [
{ ./pc.nix
_module.args.wallpaper = wallpaper.packages.${system}.default; ]
} ++ self.commonModules;
};
nur.nixosModules.nur laptop = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
{ modules =
nixpkgs.overlays = [ self.commonModules
zig.overlays.default # Add zig ++ [
( # https://github.com/nix-community/home-manager/issues/1538#issuecomment-706627100 ./laptop.nix
final: prev: { ]
unstable = import nixpkgs-unstable { ++ self.commonModules;
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;}
)
];
}
];
}; };
}; };
}; };

View File

@ -17,9 +17,6 @@
# Keyboard Layout # Keyboard Layout
home.keyboard.layout = "at"; home.keyboard.layout = "at";
# TODO Change for Laptop
targets.genericLinux.enable = false; # Enable on non-nixos ditros
imports = [ imports = [
./modules/bash.nix ./modules/bash.nix
./modules/direnv.nix ./modules/direnv.nix

11
laptop.nix Normal file
View File

@ -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";
};
};
}

View File

@ -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" = { "org/gnome/mutter" = {
edge-tiling = true; edge-tiling = true;
dynamic-workspaces = true; dynamic-workspaces = true;

View File

@ -34,10 +34,6 @@
# Creative software # Creative software
gimp gimp
davinci-resolve
# Games
osu-lazer
# Misc # Misc
comma # Run any binary from the repos with a comma `, cowsay neato` comma # Run any binary from the repos with a comma `, cowsay neato`

18
pc.nix Normal file
View File

@ -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";
};
};
}