diff --git a/clients/quadphone/gnome.nix b/clients/quadphone/gnome.nix new file mode 100644 index 0000000..727f9ea --- /dev/null +++ b/clients/quadphone/gnome.nix @@ -0,0 +1,8 @@ +{inputs, ...}: { + imports = [inputs.nixpkgs-gnome-mobile.nixosModules.gnome-mobile]; + + i18n.inputMethod = { + enable = true; + type = "ibus"; + }; +} diff --git a/clients/quadphone/hardware-configuration.nix b/clients/quadphone/hardware-configuration.nix new file mode 100644 index 0000000..e7bcf63 --- /dev/null +++ b/clients/quadphone/hardware-configuration.nix @@ -0,0 +1,20 @@ +{ + config, + inputs, + pkgs, + lib, + ... +}: { + imports = [ + (_: + import + "${inputs.sdm845}/nixos/profiles/boot/kernel/sdm845-mainline" + { + inherit pkgs lib config; + inputs = inputs.sdm845.inputs; + }) + ]; + + nixpkgs.hostPlatform = "aarch64-linux"; + nixpkgs.config.allowBroken = true; +} diff --git a/clients/quadphone/hardware-configuration.nix.nix b/clients/quadphone/hardware-configuration.nix.nix deleted file mode 100644 index d4cb634..0000000 --- a/clients/quadphone/hardware-configuration.nix.nix +++ /dev/null @@ -1,4 +0,0 @@ -{inputs, ...}: { - imports = ["${inputs.sdm845}/nixos/profiles/boot/kernel/sdm845-mainline"]; - hardware.graphics.enable32Bit = false; -} diff --git a/clients/quadphone/repart.nix b/clients/quadphone/repart.nix index 362d344..0f92c02 100644 --- a/clients/quadphone/repart.nix +++ b/clients/quadphone/repart.nix @@ -14,16 +14,26 @@ in { enable = true; partitions."03-root".Type = "root"; }; - boot.initrd.systemd = { - enable = true; - root = "gpt-auto"; - }; - boot.initrd.supportedFilesystems.ext4 = true; - fileSystems."/".device = "/dev/disk/by-label/nixos"; - fileSystems."/".fsType = "ext4"; - fileSystems."/boot".device = "/dev/disk/by-label/ESP"; - fileSystems."/boot".fsType = "vfat"; + boot.initrd = { + supportedFilesystems.ext4 = true; + systemd = { + enable = true; + root = "gpt-auto"; + }; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + }; + "/boot" = { + device = "/dev/disk/by-label/ESP"; + fsType = "vfat"; + }; + }; + image.repart = { name = "image"; partitions = { diff --git a/flake.lock b/flake.lock index 7614ea5..7e27992 100644 --- a/flake.lock +++ b/flake.lock @@ -1084,6 +1084,21 @@ "type": "github" } }, + "gnome-mobile": { + "locked": { + "lastModified": 1748795015, + "narHash": "sha256-+XyXaa3KmgOykQpo6k4XsEaHWDGj8inCxMMGOWat4EM=", + "owner": "chuangzhu", + "repo": "nixpkgs-gnome-mobile", + "rev": "825ebb10c8bf02cb4b6553f3b85e169dc92484d7", + "type": "github" + }, + "original": { + "owner": "chuangzhu", + "repo": "nixpkgs-gnome-mobile", + "type": "github" + } + }, "gnome-shell": { "flake": false, "locked": { @@ -1599,26 +1614,6 @@ "type": "github" } }, - "nh": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1751375534, - "narHash": "sha256-9z1W64dDVtVxqgPzUbjIQqRfygg1hdivUOZ6d/H+yFg=", - "owner": "nix-community", - "repo": "nh", - "rev": "d0abb8eebe32f79ce4659e68dd777cf497a5d3d2", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nh", - "type": "github" - } - }, "niri-flake": { "inputs": { "niri-stable": [ @@ -2548,10 +2543,10 @@ "disko": "disko", "firefox-gnome-theme": "firefox-gnome-theme", "flake-parts": "flake-parts", + "gnome-mobile": "gnome-mobile", "grapevine": "grapevine", "home-manager": "home-manager_2", "matrixoidc": "matrixoidc", - "nh": "nh", "nix-matrix-appservices": "nix-matrix-appservices", "nixpkgs": "nixpkgs_2", "ooye": "ooye", @@ -2732,16 +2727,16 @@ "weird-deployer": "weird-deployer" }, "locked": { - "lastModified": 1752251688, - "narHash": "sha256-u2hG3OGbZnhDNliMdWk5iGXRS5q6/XLLhvBCN7Fi/jE=", - "owner": "linyinfeng", - "repo": "dotfiles", - "rev": "0662e5ab50c35541d0b56cf5b568ca3c940b52bf", + "lastModified": 1752351560, + "narHash": "sha256-l78+LOhFBdKktQJ9ipDcJ+gne7hprjQUqeafVGU8EzQ=", + "owner": "Henry-Hiles", + "repo": "dotfiles-fork", + "rev": "1daa02b1628000a8958d444100693b8a3763c401", "type": "github" }, "original": { - "owner": "linyinfeng", - "repo": "dotfiles", + "owner": "Henry-Hiles", + "repo": "dotfiles-fork", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 7c3a452..7981fff 100755 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,6 @@ { inputs = { + gnome-mobile.url = "github:chuangzhu/nixpkgs-gnome-mobile"; nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; wrapper-manager.url = "github:viperML/wrapper-manager"; flake-parts.url = "github:hercules-ci/flake-parts"; @@ -47,16 +48,12 @@ url = "github:wamserma/flake-programs-sqlite"; inputs.nixpkgs.follows = "nixpkgs"; }; - nh = { - url = "github:nix-community/nh"; - inputs.nixpkgs.follows = "nixpkgs"; - }; firefox-gnome-theme = { url = "github:rafaelmardojai/firefox-gnome-theme"; flake = false; }; sdm845 = { - url = "github:linyinfeng/dotfiles"; + url = "github:Henry-Hiles/dotfiles-fork"; inputs.nixpkgs.follows = "nixpkgs"; }; }; @@ -67,25 +64,25 @@ opt = lib.optionals; dirFiles = type: dir: lib.filter (lib.hasSuffix type) (lib.filesystem.listFilesRecursive dir); }; - system = hostname: isDesktop: isGraphical: arch: + system = info: lib.nixosSystem { - system = "${arch}-linux"; specialArgs = { - inherit inputs isDesktop dirUtils; + inherit inputs dirUtils; + isDesktop = info.isDesktop or false; }; modules = with dirUtils; [ - ./wrappers - {networking.hostName = hostname;} + ./wrappers/default.nix + {networking.hostName = info.hostname;} inputs.agenix.nixosModules.default inputs.run0-sudo-shim.nixosModules.default ] - ++ dirFiles ".nix" ./clients/${hostname} + ++ dirFiles ".nix" ./clients/${info.hostname} ++ dirFiles ".nix" ./modules/common - ++ opt (!isDesktop) (dirFiles ".nix" ./modules/server) - ++ opt isDesktop (dirFiles ".nix" ./modules/desktop) - ++ opt isGraphical ( + ++ opt (info.isServer or false) (dirFiles ".nix" ./modules/server) + ++ opt (info.isDesktop or false) (dirFiles ".nix" ./modules/desktop) + ++ opt (info.isGraphical or info.isDesktop or false) ( (dirFiles ".nix" ./modules/graphical) ++ [ inputs.home-manager.nixosModules.home-manager @@ -102,15 +99,11 @@ formatter = pkgs.alejandra; }; - flake.nixosConfigurations = builtins.mapAttrs (name: value: system name value.isDesktop (value.isGraphical or value.isDesktop) (value.arch or "x86_64")) { - "quadraticserver".isDesktop = false; + flake.nixosConfigurations = builtins.mapAttrs (name: value: system (value // {hostname = name;})) { "quadraticpc".isDesktop = true; "quadtop".isDesktop = true; - "quadphone" = { - isDesktop = true; - isGraphical = true; - arch = "aarch64"; - }; + "quadraticserver".isServer = true; + "quadphone".isGraphical = true; }; }; } diff --git a/modules/common/arch.nix b/modules/common/arch.nix new file mode 100644 index 0000000..30deaf8 --- /dev/null +++ b/modules/common/arch.nix @@ -0,0 +1,6 @@ +{lib, ...}: { + nixpkgs = { + hostPlatform = lib.mkDefault "x86_64-linux"; + buildPlatform = "x86_64-linux"; + }; +} diff --git a/modules/common/nh.nix b/modules/common/nh.nix index cc53d1b..e848719 100644 --- a/modules/common/nh.nix +++ b/modules/common/nh.nix @@ -1,23 +1,14 @@ { - inputs, - pkgs, - lib, - ... -}: let - pkg = inputs.nh.packages.${pkgs.system}.default; - exe = lib.getExe pkg; -in { programs.nh = { enable = true; - package = pkg; clean.enable = true; flake = "/home/quadradical/.config/nixos"; }; environment.shellAliases = { - clean = "${exe} clean all"; + clean = "nh clean all"; update = "env -C ~/.config/nixos nix flake update && rebuild"; - rebuild = "${exe} os switch"; - rebuild-server = "${exe} os switch --hostname quadraticserver --target-host 192.168.0.132"; + rebuild = "nh os switch"; + rebuild-server = "nh os switch --hostname quadraticserver --target-host 192.168.0.132"; }; } diff --git a/modules/graphical/noisetorch.nix b/modules/desktop/noisetorch.nix similarity index 100% rename from modules/graphical/noisetorch.nix rename to modules/desktop/noisetorch.nix diff --git a/modules/desktop/packages.nix b/modules/desktop/packages.nix index 8afc6ab..b937a5d 100644 --- a/modules/desktop/packages.nix +++ b/modules/desktop/packages.nix @@ -5,6 +5,7 @@ inkscape r2modman libreoffice + cinny-desktop prismlauncher nexusmods-app-unfree ]; diff --git a/modules/graphical/packages.nix b/modules/graphical/packages.nix index 18d8caf..a92a229 100644 --- a/modules/graphical/packages.nix +++ b/modules/graphical/packages.nix @@ -8,7 +8,6 @@ wl-clipboard google-cursor authenticator - cinny-desktop papirus-icon-theme ]; } diff --git a/wrappers/common-desktop/steam.nix b/wrappers/common-desktop/steam.nix deleted file mode 100644 index 01db76c..0000000 --- a/wrappers/common-desktop/steam.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - # wrappers.steam = { - # basePackage = pkgs.steam; - # env.MANGOHUD.value = "1"; - # }; -} diff --git a/wrappers/default.nix b/wrappers/default.nix index 0f0b89f..ce95cbb 100644 --- a/wrappers/default.nix +++ b/wrappers/default.nix @@ -9,7 +9,7 @@ (inputs.wrapper-manager.lib { inherit pkgs; specialArgs = {inherit inputs;}; - modules = with dirUtils; dirFiles ".nix" ./common ++ opt isDesktop (dirFiles ".nix" ./common-desktop); + modules = with dirUtils; dirFiles ".nix" ./common ++ opt isDesktop (dirFiles ".nix" ./desktop); }) .config.build.toplevel ]; diff --git a/wrappers/common/agenix.nix b/wrappers/desktop/agenix.nix similarity index 100% rename from wrappers/common/agenix.nix rename to wrappers/desktop/agenix.nix