From 6f048a58bc1449e0b1992b0a48228a204317b4b8 Mon Sep 17 00:00:00 2001 From: joygnu Date: Thu, 4 Jul 2024 12:57:40 +0200 Subject: [PATCH] desktop --- flake.lock | 12 ++++++------ flake.nix | 4 ++-- home/zsh/default.nix | 6 ++---- home/zsh/{pc-laptop.sh => desktop-laptop.sh} | 6 ++---- hosts/{pc => desktop}/default.nix | 2 +- hosts/{pc => desktop}/hardware.nix | 0 6 files changed, 13 insertions(+), 17 deletions(-) rename home/zsh/{pc-laptop.sh => desktop-laptop.sh} (50%) rename hosts/{pc => desktop}/default.nix (90%) rename hosts/{pc => desktop}/hardware.nix (100%) diff --git a/flake.lock b/flake.lock index 424901e..68721be 100644 --- a/flake.lock +++ b/flake.lock @@ -41,11 +41,11 @@ ] }, "locked": { - "lastModified": 1719827439, - "narHash": "sha256-tneHOIv1lEavZ0vQ+rgz67LPNCgOZVByYki3OkSshFU=", + "lastModified": 1720045378, + "narHash": "sha256-lmE7B+QXw7lWdBu5GQlUABSpzPk3YBb9VbV+IYK5djk=", "owner": "nix-community", "repo": "home-manager", - "rev": "59ce796b2563e19821361abbe2067c3bb4143a7d", + "rev": "0a30138c694ab3b048ac300794c2eb599dc40266", "type": "github" }, "original": { @@ -106,11 +106,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1719915469, - "narHash": "sha256-dNQPEges+os5o3SpV3gkIJk2wNX+eIzv6D48S3WxBRo=", + "lastModified": 1720087678, + "narHash": "sha256-uOhYJU3ldDKXYV+mFaXcPtyjq/UIMh/6SCuoVNU9rxM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "88d829e52cfbeee71d81704ce28f5b439f6dea16", + "rev": "1afc5440469f94e7ed26e8648820971b102afdc3", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index b00faf2..f9aedaa 100644 --- a/flake.nix +++ b/flake.nix @@ -14,10 +14,10 @@ }; outputs = { nixpkgs, home-manager, ... }@inputs: { - nixosConfigurations.pc = nixpkgs.lib.nixosSystem { + nixosConfigurations.desktop = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs;}; modules = [ - ./hosts/pc + ./hosts/desktop ]; }; nixosConfigurations.laptop = nixpkgs.lib.nixosSystem { diff --git a/home/zsh/default.nix b/home/zsh/default.nix index fa0aec0..56ac775 100644 --- a/home/zsh/default.nix +++ b/home/zsh/default.nix @@ -12,16 +12,14 @@ pu = "bash ~/nix/home/zsh/push.sh"; fr = "sudo systemctl reboot --firmware"; ser = "ssh root@joygnu.org"; - rb = "bash ~/nix/home/zsh/pc-laptop.sh"; + rb = "bash ~/nix/home/zsh/desktop-laptop.sh"; up = "sudo nix flake update ~/nix"; del = "sudo nix-collect-garbage -d"; - gtk = "nvim ~/nix/home/gtk/default.nix"; hy = "nvim ~/nix/home/hyprland/default.nix"; zs = "nvim ~/nix/home/zsh/default.nix"; - ec = "nvim ~/nix/hosts/pc/default.nix"; el = "nvim ~/nix/hosts/laptop/default.nix"; ef = "nvim ~/nix/flake.nix"; - ep = "nvim ~/nix/hosts/pc/default.nix"; + ed = "nvim ~/nix/hosts/desktop/default.nix"; eh = "nvim ~/nix/home/default.nix"; em = "nvim ~/nix/modules/misc/default.nix"; es = "nvim ~/nix/modules/stylix/default.nix"; diff --git a/home/zsh/pc-laptop.sh b/home/zsh/desktop-laptop.sh similarity index 50% rename from home/zsh/pc-laptop.sh rename to home/zsh/desktop-laptop.sh index 059bab2..9eff3ca 100755 --- a/home/zsh/pc-laptop.sh +++ b/home/zsh/desktop-laptop.sh @@ -2,11 +2,9 @@ hostname=$(hostname) -if [[ $hostname == *"pc"* ]]; then - echo "This machine is identified as a Desktop PC." - sudo nixos-rebuild switch --flake ~/nix/#pc +if [[ $hostname == *"desktop"* ]]; then + sudo nixos-rebuild switch --flake ~/nix/#desktop elif [[ $hostname == *"laptop"* ]]; then - echo "This machine is identified as a Laptop." sudo nixos-rebuild switch --flake ~/nix/#laptop else echo "Unable to determine the type of machine." diff --git a/hosts/pc/default.nix b/hosts/desktop/default.nix similarity index 90% rename from hosts/pc/default.nix rename to hosts/desktop/default.nix index 7c57288..26ff53a 100644 --- a/hosts/pc/default.nix +++ b/hosts/desktop/default.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, modulesPath, inputs, ... }: { - networking.hostName = "pc"; + networking.hostName = "desktop"; networking.networkmanager.enable = true; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; diff --git a/hosts/pc/hardware.nix b/hosts/desktop/hardware.nix similarity index 100% rename from hosts/pc/hardware.nix rename to hosts/desktop/hardware.nix