From 55f747bed51c2859908515fe6f18709ccea2b402 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Sat, 27 Apr 2024 13:16:00 -0400 Subject: [PATCH] trying flakes --- flake.bu.nix | 82 +++++++++++++++++++ flake.nix | 2 +- .../fwbook.hardware-configuration.nix | 0 hosts/fwbook.nix | 20 +++++ 4 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 flake.bu.nix rename hardware-configs/fwbook.nix => hosts/fwbook.hardware-configuration.nix (100%) create mode 100644 hosts/fwbook.nix diff --git a/flake.bu.nix b/flake.bu.nix new file mode 100644 index 0000000..65ea880 --- /dev/null +++ b/flake.bu.nix @@ -0,0 +1,82 @@ +{ + inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-23.11; + inputs.home-manager.url = github:nix-community/home-manager; + inputs.fh.url = "https://flakehub.com/f/DeterminateSystems/fh/*.tar.gz"; + inputs.nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + + + outputs = + { self + , nixpkgs + , home-manager + , fh + , nixos-hardware + }@attrs: + let + user = { + name = "ari"; + fullName = "Ari Sosnovsky"; + email = "ariel@sosnovsky.ca"; + }; + dataDir = "/mnt/Data"; + systemStateVersion = "23.11"; + homeMangerVersion = "23.11"; + hostName = "fwbook"; + in + { + nixosConfigurations.fwbook = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./hardware-configs/fwbook.nix + nixos-hardware.nixosModules.framework-13-7040-amd + (import ./modules/os/nix.nix { + systemStateVersion = systemStateVersion; + }) + (import ./modules/os/core.nix { + user = user; + hostName = hostName; + firewall = { enable = true; }; + }) + (import ./modules/os/hardware.nix { + enableFingerPrint = true; + }) + (import ./modules/os/ssh.nix { + user = user; + enableSSHServer = false; + }) + ./modules/os/services.nix + ./modules/docker/core.nix + (import ./modules/user.nix { + user = user; + }) + (import ./modules/rootUser.nix { + hostName = hostName; + }) + home-manager.nixosModules.default + fh.packages.x86_64-linux.default + (import ./modules/optional/home-manager-config.nix { + homeMangerVersion = homeMangerVersion; + hostName = hostName; + user = user; + }) + ./modules/optional/amd-packages.nix + ./modules/optional/gnome.nix + (import ./modules/optional/hyprland.nix { + user = user; + }) + { + hardware.framework.amd-7040.preventWakeOnAC = true; + services.fwupd.enable = true; + fileSystems."${dataDir}" = { + device = "/dev/sda1"; + fsType = "ext4"; + options = [ + "users" + "nofail" + ]; + }; + } + ]; + }; + }; +} diff --git a/flake.nix b/flake.nix index ee91c05..889c9b8 100644 --- a/flake.nix +++ b/flake.nix @@ -27,7 +27,7 @@ nixosConfigurations.fwbook = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ - ./hardware-configs/fwbook.nix + ./hosts/fwbook.nix (import ./main.nix { enableFingerPrint = true; hostName = "fwbook"; diff --git a/hardware-configs/fwbook.nix b/hosts/fwbook.hardware-configuration.nix similarity index 100% rename from hardware-configs/fwbook.nix rename to hosts/fwbook.hardware-configuration.nix diff --git a/hosts/fwbook.nix b/hosts/fwbook.nix new file mode 100644 index 0000000..4b6d1dd --- /dev/null +++ b/hosts/fwbook.nix @@ -0,0 +1,20 @@ +{ user +, dataDir ? "/mnt/Data" +}: +{ ... }: +{ + imports = + [ + ./fwbook.hardware-configuration.nix + ]; + hardware.framework.amd-7040.preventWakeOnAC = true; + services.fwupd.enable = true; + fileSystems."${dataDir}" = { + device = "/dev/sda1"; + fsType = "ext4"; + options = [ + "users" + "nofail" + ]; + }; +}