adds experimental flake per host settings

This commit is contained in:
Menno van Leeuwen 2024-11-01 23:57:48 +01:00
parent 728df20792
commit de0a20bf73
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE
3 changed files with 31 additions and 3 deletions

View File

@ -104,7 +104,7 @@ sys_packages() {
brew cleanup brew cleanup
else else
if [ -x "$(command -v nixos-version)" ]; then if [ -x "$(command -v nixos-version)" ]; then
sudo nixos-rebuild switch cd $HOME/dotfiles/config/nixos && sudo nixos-rebuild switch --flake .#$DOTF_HOSTNAME
# Exit if this failed # Exit if this failed
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
@ -211,7 +211,7 @@ git_repos() {
} }
homemanager() { homemanager() {
cd $HOME/dotfiles/config/home-manager && NIXPKGS_ALLOW_UNFREE=1 home-manager switch cd $HOME/dotfiles/config/home-manager && NIXPKGS_ALLOW_UNFREE=1 home-manager switch -b backup
} }
ensure_homemanager_installed() { ensure_homemanager_installed() {

View File

@ -4,7 +4,6 @@
# Include the results of the hardware scan. # Include the results of the hardware scan.
/etc/nixos/hardware-configuration.nix /etc/nixos/hardware-configuration.nix
./packages/default.nix ./packages/default.nix
./nvidia.nix
./virtualization.nix ./virtualization.nix
./users.nix ./users.nix
./flatpak.nix ./flatpak.nix

29
config/nixos/flake.nix Normal file
View File

@ -0,0 +1,29 @@
{
description = "menno's dotfiles";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.05";
};
outputs =
{ self, nixpkgs }:
{
nixosConfigurations = {
"mennos-laptop" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
./nvidia.nix
{ networking.hostName = "mennos-laptop"; }
];
};
"mennos-gamingpc" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
{ networking.hostName = "mennos-desktop"; }
];
};
};
};
}