From 9b5fb67c777da1ab48f421b936e271d512351e3d Mon Sep 17 00:00:00 2001 From: mjallen18 Date: Sun, 18 Feb 2024 13:25:15 -0600 Subject: [PATCH] moving stuff around --- ...configuration.nix => configuration-pi4.nix | 1 + configuration.nix | 1 + pi4/docker.nix => docker-pi4.nix | 0 flake.nix | 16 +++++++ ...tion.nix => hardware-configuration-pi4.nix | 0 home.nix | 2 +- pi4/flake.lock | 42 ------------------- pi4/flake.nix | 18 -------- scripts/.directory | 2 + scripts/garbage-collection | 2 + scripts/power-limit | 3 ++ reset_wifi => scripts/reset_wifi | 0 scripts/update-flakes | 2 + 13 files changed, 28 insertions(+), 61 deletions(-) rename pi4/configuration.nix => configuration-pi4.nix (98%) rename pi4/docker.nix => docker-pi4.nix (100%) rename pi4/hardware-configuration.nix => hardware-configuration-pi4.nix (100%) delete mode 100644 pi4/flake.lock delete mode 100644 pi4/flake.nix create mode 100644 scripts/.directory create mode 100755 scripts/garbage-collection create mode 100755 scripts/power-limit rename reset_wifi => scripts/reset_wifi (100%) create mode 100644 scripts/update-flakes diff --git a/pi4/configuration.nix b/configuration-pi4.nix similarity index 98% rename from pi4/configuration.nix rename to configuration-pi4.nix index e2855c1..b25073f 100644 --- a/pi4/configuration.nix +++ b/configuration-pi4.nix @@ -10,6 +10,7 @@ let SSID = "Joey’s Jungle"; SSIDpassword = "kR8v&3Qd"; interface = "wlan0"; + timezone = "America/Chicago"; hostname = "nixos-pi4"; in { imports = diff --git a/configuration.nix b/configuration.nix index a2bd90b..2c455e3 100644 --- a/configuration.nix +++ b/configuration.nix @@ -5,6 +5,7 @@ { config, lib, pkgs, ... }: let user = "matt"; + password = "$y$j9T$EkPXmsmIMFFZ.WRrBYCxS1$P0kwo6e4.WM5DsqUcEqWC3MrZp5KfCjxffraMFZWu06"; hostname = "matt-nixos"; timezone = "America/Chicago"; # discover-wrapper is needed as of 1/24/24 since PackageKit does not work correctly so this removes error messages. diff --git a/pi4/docker.nix b/docker-pi4.nix similarity index 100% rename from pi4/docker.nix rename to docker-pi4.nix diff --git a/flake.nix b/flake.nix index b4f740b..d2373c1 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,10 @@ description = "flake for matt-nixos"; inputs = { + # Common nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + # Desktop kde.url = "github:nix-community/kde2nix"; nix-flatpak.url = "github:gmodena/nix-flatpak"; # impermanence.url = "github:nix-community/impermanence"; @@ -12,11 +15,15 @@ url = "github:nix-community/lanzaboote/v0.3.0"; inputs.nixpkgs.follows = "nixpkgs"; }; + + # Pi4 + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; }; # outputs = { self, nixpkgs, impermanence, lanzaboote } @ inputs: { outputs = { self, nixpkgs, lanzaboote, kde, nix-flatpak, home-manager } @ inputs: { nixosConfigurations = { + # Desktop "matt-nixos" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ @@ -34,6 +41,15 @@ } ]; }; + + # Pi4 + "nixos-pi4" = nixpkgs.lib.nixosSystem { + system = "aarch64-linux"; + modules = [ + nixos-hardware.nixosModules.raspberry-pi-4 + ./configuration.nix + ]; + }; }; }; } diff --git a/pi4/hardware-configuration.nix b/hardware-configuration-pi4.nix similarity index 100% rename from pi4/hardware-configuration.nix rename to hardware-configuration-pi4.nix diff --git a/home.nix b/home.nix index 70f81a3..38fbdf7 100644 --- a/home.nix +++ b/home.nix @@ -28,7 +28,7 @@ WantedBy = [ "default.target" ]; }; Service = { - ExecStart = "/home/matt/nix-config/reset_wifi"; + ExecStart = "/home/matt/nix-config/scripts/reset_wifi"; # ExecStart = "${pkgs.writeShellScript "fix-wifi" '' # #!/usr/bin/env bash # echo 1 | sudo -u root tee /sys/bus/pci/devices/0000\:09\:00.0/reset diff --git a/pi4/flake.lock b/pi4/flake.lock deleted file mode 100644 index 1199271..0000000 --- a/pi4/flake.lock +++ /dev/null @@ -1,42 +0,0 @@ -{ - "nodes": { - "nixos-hardware": { - "locked": { - "lastModified": 1708091350, - "narHash": "sha256-o28BJYi68qqvHipT7V2jkWxDiMS1LF9nxUsou+eFUPQ=", - "owner": "NixOS", - "repo": "nixos-hardware", - "rev": "106d3fec43bcea19cb2e061ca02531d54b542ce3", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "master", - "repo": "nixos-hardware", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1708151420, - "narHash": "sha256-MGT/4aGCWQPQiu6COqJdCj9kSpLPiShgbwpbC38YXC8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "6e2f00c83911461438301db0dba5281197fe4b3a", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "root": { - "inputs": { - "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/pi4/flake.nix b/pi4/flake.nix deleted file mode 100644 index 4021075..0000000 --- a/pi4/flake.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - description = "NixOS configuration with flakes for raspberry pi 4"; - inputs = { - nixos-hardware.url = "github:NixOS/nixos-hardware/master"; - }; - - outputs = { self, nixpkgs, nixos-hardware } @ inputs: { - nixosConfigurations = { - "nixos-pi4" = nixpkgs.lib.nixosSystem { - system = "aarch64-linux"; - modules = [ - nixos-hardware.nixosModules.raspberry-pi-4 - ./configuration.nix - ]; - }; - }; - }; -} diff --git a/scripts/.directory b/scripts/.directory new file mode 100644 index 0000000..aa092a8 --- /dev/null +++ b/scripts/.directory @@ -0,0 +1,2 @@ +[Desktop Entry] +Icon=folder-script diff --git a/scripts/garbage-collection b/scripts/garbage-collection new file mode 100755 index 0000000..19cf2db --- /dev/null +++ b/scripts/garbage-collection @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +sudo nix-store --gc diff --git a/scripts/power-limit b/scripts/power-limit new file mode 100755 index 0000000..157d59b --- /dev/null +++ b/scripts/power-limit @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +sudo su - root +echo 293000000 > /sys/class/drm/card0/device/hwmon/hwmon0/power1_cap \ No newline at end of file diff --git a/reset_wifi b/scripts/reset_wifi similarity index 100% rename from reset_wifi rename to scripts/reset_wifi diff --git a/scripts/update-flakes b/scripts/update-flakes new file mode 100644 index 0000000..6bf8fba --- /dev/null +++ b/scripts/update-flakes @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +sudo nix flake update \ No newline at end of file