diff --git a/.archive/flake.nix b/.archive/flake.nix new file mode 100644 index 0000000..3c283ff --- /dev/null +++ b/.archive/flake.nix @@ -0,0 +1,36 @@ +{ + "durincore" = mkNixosConfig { + # T470 Thinkpad Intel i7-6600U + # Backup Nix dev laptop + hostname = "durincore"; + system = "x86_64-linux"; + hardwareModules = [ + ./nixos/profiles/hw-thinkpad-t470.nix + inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t470s + ]; + profileModules = [ + ./nixos/profiles/role-workstation.nix + ./nixos/profiles/role-dev.nix + { home-manager.users.jahanson = ./nixos/home/jahanson/workstation.nix; } + ]; + }; + + "legiondary" = mkNixosConfig { + # Legion 15arh05h AMD/Nvidia Ryzen 7 4800H + # Nix dev/gaming laptop + hostname = "legiondary"; + system = "x86_64-linux"; + hardwareModules = [ + inputs.nixos-hardware.nixosModules.lenovo-legion-15arh05h + ./nixos/profiles/hw-legion-15arh05h.nix + disko.nixosModules.disko + (import ./nixos/profiles/disko-nixos.nix { disks = [ "/dev/nvme0n1" ]; }) + ]; + profileModules = [ + ./nixos/profiles/role-dev.nix + ./nixos/profiles/role-gaming.nix + ./nixos/profiles/role-workstation.nix + { home-manager.users.jahanson = ./nixos/home/jahanson/workstation.nix; } + ]; + }; +} diff --git a/nixos/hosts/durincore/default.nix b/.archive/hosts/durincore/default.nix similarity index 100% rename from nixos/hosts/durincore/default.nix rename to .archive/hosts/durincore/default.nix diff --git a/nixos/hosts/legiondary/default.nix b/.archive/hosts/legiondary/default.nix similarity index 100% rename from nixos/hosts/legiondary/default.nix rename to .archive/hosts/legiondary/default.nix diff --git a/nixos/profiles/hw-legion-15arh05h.nix b/.archive/profiles/hw-legion-15arh05h.nix similarity index 100% rename from nixos/profiles/hw-legion-15arh05h.nix rename to .archive/profiles/hw-legion-15arh05h.nix diff --git a/nixos/profiles/hw-thinkpad-t470.nix b/.archive/profiles/hw-thinkpad-t470.nix similarity index 100% rename from nixos/profiles/hw-thinkpad-t470.nix rename to .archive/profiles/hw-thinkpad-t470.nix diff --git a/flake.nix b/flake.nix index 3d10deb..8bb8d6f 100644 --- a/flake.nix +++ b/flake.nix @@ -168,41 +168,6 @@ }; in { - "durincore" = mkNixosConfig { - # T470 Thinkpad Intel i7-6600U - # Backup Nix dev laptop - hostname = "durincore"; - system = "x86_64-linux"; - hardwareModules = [ - ./nixos/profiles/hw-thinkpad-t470.nix - inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t470s - ]; - profileModules = [ - ./nixos/profiles/role-workstation.nix - ./nixos/profiles/role-dev.nix - { home-manager.users.jahanson = ./nixos/home/jahanson/workstation.nix; } - ]; - }; - - "legiondary" = mkNixosConfig { - # Legion 15arh05h AMD/Nvidia Ryzen 7 4800H - # Nix dev/gaming laptop - hostname = "legiondary"; - system = "x86_64-linux"; - hardwareModules = [ - inputs.nixos-hardware.nixosModules.lenovo-legion-15arh05h - ./nixos/profiles/hw-legion-15arh05h.nix - disko.nixosModules.disko - (import ./nixos/profiles/disko-nixos.nix { disks = [ "/dev/nvme0n1" ]; }) - ]; - profileModules = [ - ./nixos/profiles/role-dev.nix - ./nixos/profiles/role-gaming.nix - ./nixos/profiles/role-workstation.nix - { home-manager.users.jahanson = ./nixos/home/jahanson/workstation.nix; } - ]; - }; - "telchar" = mkNixosConfig { # Framework 16 Ryzen 7 7840HS - Radeon 780M Graphics # Nix dev laptop diff --git a/nixos/hosts/gandalf/default.nix b/nixos/hosts/gandalf/default.nix index 0ab997e..762acf5 100644 --- a/nixos/hosts/gandalf/default.nix +++ b/nixos/hosts/gandalf/default.nix @@ -124,8 +124,9 @@ in }; }; services = { - podman.enable = true; + glances.enable = true; libvirt-qemu.enable = true; + podman.enable = true; # Scrutiny scrutiny = { diff --git a/nixos/modules/nixos/hardware/default.nix b/nixos/modules/nixos/hardware/default.nix index efa0833..688c9a2 100644 --- a/nixos/modules/nixos/hardware/default.nix +++ b/nixos/modules/nixos/hardware/default.nix @@ -1,5 +1,5 @@ { imports = [ - ./nvidia + # ./nvidia ]; } diff --git a/nixos/modules/nixos/services/default.nix b/nixos/modules/nixos/services/default.nix index 0927e6d..061f97c 100644 --- a/nixos/modules/nixos/services/default.nix +++ b/nixos/modules/nixos/services/default.nix @@ -4,6 +4,7 @@ ./cockpit ./dnsmasq ./forgejo + ./glances ./haproxy ./libvirt-qemu ./matchbox diff --git a/nixos/modules/nixos/services/glances/default.nix b/nixos/modules/nixos/services/glances/default.nix new file mode 100644 index 0000000..598bd19 --- /dev/null +++ b/nixos/modules/nixos/services/glances/default.nix @@ -0,0 +1,52 @@ +{ pkgs, config, lib, ... }: +let + cfg = config.mySystem.services.glances; +in +with lib; +{ + options.mySystem.services.glances = + { + enable = mkEnableOption "Glances system monitor"; + }; + config = mkIf cfg.enable { + + environment.systemPackages = with pkgs; + [ glances python310Packages.psutil hddtemp ]; + + # port 61208 + systemd.services.glances = { + script = '' + ${pkgs.glances}/bin/glances --enable-plugin smart --webserver --bind 0.0.0.0 + ''; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + }; + + networking = { + firewall.allowedTCPPorts = [ 61208 ]; + }; + + environment.etc."glances/glances.conf" = { + text = '' + [global] + check_update=False + + [network] + hide=lo,docker.* + + [diskio] + hide=loop.* + + [containers] + disable=False + podman_sock=unix:///var/run/podman/podman.sock + + [connections] + disable=True + + [irq] + disable=True + ''; + }; + }; +}