From 6cb0ead41b889c20c1710dfd620d6550044a1d73 Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Tue, 7 May 2024 13:13:37 +0200 Subject: [PATCH] de-flake: part 3 --- common/hardware/tlp.nix | 6 +- common/tooling/nix.nix | 7 +- configuration.nix | 3 +- fake_flake.nix | 6 +- flake.lock | 525 ------------------------------------ flake.nix | 50 ---- modules/system-packages.nix | 6 - sway/default.nix | 2 +- 8 files changed, 12 insertions(+), 593 deletions(-) delete mode 100644 flake.lock delete mode 100644 flake.nix delete mode 100644 modules/system-packages.nix diff --git a/common/hardware/tlp.nix b/common/hardware/tlp.nix index 81c7fd9..c0f2b4b 100644 --- a/common/hardware/tlp.nix +++ b/common/hardware/tlp.nix @@ -1,9 +1,9 @@ -{ pkgs, config, lib, system, ... }: +{ pkgs, config, lib, ... }: let cfg = config.grimmShared; inherit (lib) optionals optional optionalString concatLines getExe; inherit (config.boot.kernelPackages) x86_energy_perf_policy cpupower; - enable_perf_policy = (lib.elem system x86_energy_perf_policy.meta.platforms); + enable_perf_policy = (lib.elem builtins.currentSystem x86_energy_perf_policy.meta.platforms); powersave = with pkgs; writeShellScriptBin "powersave-mode" (concatLines ([ "${getExe cpupower} frequency-set -g powersave -u 2000000" # clock speed @@ -36,7 +36,7 @@ in performance auto ] ++ optionals graphical [ - tlpui + # tlpui ] ++ optional enable_perf_policy x86_energy_perf_policy; services.acpid = { diff --git a/common/tooling/nix.nix b/common/tooling/nix.nix index 5cbd388..87e46d3 100644 --- a/common/tooling/nix.nix +++ b/common/tooling/nix.nix @@ -1,4 +1,4 @@ -{ pkgs, config, lib, inputs, system, ... }: +{ pkgs, config, lib, inputs, ... }: let cfg = config.grimmShared; in @@ -8,6 +8,7 @@ in (writeShellScriptBin "nix-referrers" "nix-store --query --referrers $@") (writeShellScriptBin "nixpkgs-review-head" "nixpkgs-review rev HEAD") (writeShellScriptBin "fmt-all" ''find ./ -readable -writable -type f | grep "\.nix" | xargs nixpkgs-fmt'') + (writeShellScriptBin "rebuild" "bash -c \"nixos-rebuild switch |& nom\"") nixpkgs-review nixpkgs-fmt @@ -19,7 +20,7 @@ in niv ]; - environment.sessionVariables = { + environment.sessionVariables = lib.mkIf config.nixpkgs.pkgs.config.allowUnfree { NIXPKGS_ALLOW_UNFREE = "1"; }; @@ -27,7 +28,6 @@ in vim-nix ]; - nixpkgs.config.allowUnfree = true; nix.settings = { experimental-features = [ "nix-command" "flakes" ]; warn-dirty = false; @@ -39,7 +39,6 @@ in }; # nix.package = pkgs.nixVersions.latest; nix.optimise.automatic = true; - nixpkgs.hostPlatform = system; boot.tmp.cleanOnBoot = true; } diff --git a/configuration.nix b/configuration.nix index 8081c5c..20aaaba 100644 --- a/configuration.nix +++ b/configuration.nix @@ -7,8 +7,7 @@ ./fake_flake.nix ./specific/grimm-nixos-laptop/configuration.nix ./modules/users.nix - ./modules/system-packages.nix - ./modules/kvm.nix + # ./modules/kvm.nix ./sway ]; diff --git a/fake_flake.nix b/fake_flake.nix index 4ea0a4f..f1d5159 100644 --- a/fake_flake.nix +++ b/fake_flake.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, ... }: +{ pkgs, lib, config, ... }: let nivSources = import ./nix/sources.nix; asGithubRef = src: "github:${src.owner}/${src.repo}/${src.rev}"; @@ -12,8 +12,10 @@ in nixpkgs.hostPlatform = "x86_64-linux"; + nixpkgs.pkgs = import nivSources.nixpkgs { allowUnfree = true; }; + nixpkgs.overlays = lib.singleton (final: prev: { - agenix = final.callPackage "${nivSources.agenix}/pkgs/agenix.nix" { }; + agenix = final.callPackage "${nivSources.agenix}/pkgs/agenix.nix" { }; }); nix.settings.extra-substituters = [ diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 1773035..0000000 --- a/flake.lock +++ /dev/null @@ -1,525 +0,0 @@ -{ - "nodes": { - "attic": { - "inputs": { - "crane": [ - "chaotic", - "crane" - ], - "flake-compat": [ - "chaotic", - "flake-compat" - ], - "flake-utils": [ - "chaotic", - "flake-utils" - ], - "nixpkgs": [ - "chaotic", - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable" - }, - "locked": { - "lastModified": 1711742460, - "narHash": "sha256-0O4v6e4a1toxXZ2gf5INhg4WPE5C5T+SVvsBt+45Mcc=", - "rev": "4dbdbee45728d8ce5788db6461aaaa89d98081f0", - "revCount": 197, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/zhaofengli/attic/0.1.197%2Brev-4dbdbee45728d8ce5788db6461aaaa89d98081f0/018e8bce-1229-7d78-a052-5121272f0341/source.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://flakehub.com/f/zhaofengli/attic/0.1.%2A.tar.gz" - } - }, - "chaotic": { - "inputs": { - "attic": "attic", - "compare-to": "compare-to", - "conduit": "conduit", - "crane": "crane", - "fenix": "fenix", - "flake-compat": "flake-compat", - "flake-schemas": "flake-schemas", - "flake-utils": "flake-utils", - "home-manager": "home-manager", - "jovian": "jovian", - "jujutsu": "jujutsu", - "niri": "niri", - "nix-filter": "nix-filter", - "nixpkgs": [ - "nixpkgs" - ], - "systems": "systems", - "yafas": "yafas" - }, - "locked": { - "lastModified": 1714768132, - "narHash": "sha256-Ln0WH0tGA4ZHF9oCVtKsa7yHHhMtdJ2v8oajefpgit4=", - "owner": "chaotic-cx", - "repo": "nyx", - "rev": "e00c0592bf535a2608326263182340c1df2f5f78", - "type": "github" - }, - "original": { - "owner": "chaotic-cx", - "ref": "nyxpkgs-unstable", - "repo": "nyx", - "type": "github" - } - }, - "compare-to": { - "locked": { - "lastModified": 1695341185, - "narHash": "sha256-htO6DSbWyCgaDkxi7foPjXwJFPzGjVt3RRUbPSpNtZY=", - "rev": "98b8e330823a3570d328720f87a1153f8a7f2224", - "revCount": 2, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/chaotic-cx/nix-empty-flake/0.1.2%2Brev-98b8e330823a3570d328720f87a1153f8a7f2224/018aba35-d228-7fa9-b205-7616c89ef4e0/source.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://flakehub.com/f/chaotic-cx/nix-empty-flake/%3D0.1.2.tar.gz" - } - }, - "complement": { - "flake": false, - "locked": { - "lastModified": 1714472853, - "narHash": "sha256-CNRHSZe3TE+3tFj2dHNyxTMjDqL0MKY3P/3jqUgA7YE=", - "owner": "matrix-org", - "repo": "complement", - "rev": "891d18872c153d39a9ce63b545045efddb845738", - "type": "github" - }, - "original": { - "owner": "matrix-org", - "ref": "main", - "repo": "complement", - "type": "github" - } - }, - "conduit": { - "inputs": { - "attic": [ - "chaotic", - "attic" - ], - "complement": "complement", - "crane": [ - "chaotic", - "crane" - ], - "fenix": [ - "chaotic", - "fenix" - ], - "flake-compat": [ - "chaotic", - "flake-compat" - ], - "flake-utils": [ - "chaotic", - "flake-utils" - ], - "nix-filter": [ - "chaotic", - "nix-filter" - ], - "nixpkgs": [ - "chaotic", - "nixpkgs" - ], - "rocksdb": "rocksdb" - }, - "locked": { - "lastModified": 1714717104, - "narHash": "sha256-c+LnBnWKPQxNK6ebEe9RYlvGDkhEKJbSO6n0pZrKjdY=", - "owner": "girlbossceo", - "repo": "conduwuit", - "rev": "42e3567153f20ace6f287d46fff2d7c070b68840", - "type": "github" - }, - "original": { - "owner": "girlbossceo", - "repo": "conduwuit", - "type": "github" - } - }, - "crane": { - "inputs": { - "nixpkgs": [ - "chaotic", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1706473297, - "narHash": "sha256-FbxuYIrHaXpsYCLtI1gCNJhd+qvERjPibXL3ctmVaCs=", - "rev": "fe812ef0dad5bb93a56c599d318be176d080281d", - "revCount": 493, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/ipetkov/crane/0.16.1/018d51be-1c17-765e-babc-c9e3bc8a5a14/source.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://flakehub.com/f/ipetkov/crane/%3D0.16.1.tar.gz" - } - }, - "fenix": { - "inputs": { - "nixpkgs": [ - "chaotic", - "nixpkgs" - ], - "rust-analyzer-src": "rust-analyzer-src" - }, - "locked": { - "lastModified": 1714544767, - "narHash": "sha256-kF1bX+YFMedf1g0PAJYwGUkzh22JmULtj8Rm4IXAQKs=", - "rev": "73124e1356bde9411b163d636b39fe4804b7ca45", - "revCount": 1852, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/nix-community/fenix/0.1.1852%2Brev-73124e1356bde9411b163d636b39fe4804b7ca45/018f333a-c195-795f-9e07-b43b47d5391f/source.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://flakehub.com/f/nix-community/fenix/0.1.%2A.tar.gz" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "revCount": 57, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://flakehub.com/f/edolstra/flake-compat/%2A.tar.gz" - } - }, - "flake-schemas": { - "locked": { - "lastModified": 1693491534, - "narHash": "sha256-ifw8Td8kD08J8DxFbYjeIx5naHcDLz7s2IFP3X42I/U=", - "rev": "c702cbb663d6d70bbb716584a2ee3aeb35017279", - "revCount": 21, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.1.1/018a4c59-80e1-708a-bb4d-854930c20f72/source.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://flakehub.com/f/DeterminateSystems/flake-schemas/%3D0.1.1.tar.gz" - } - }, - "flake-utils": { - "inputs": { - "systems": [ - "chaotic", - "systems" - ] - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "revCount": 92, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/numtide/flake-utils/0.1.92%2Brev-b1d9ab70662946ef0850d488da1c9019f3a9752a/018e2ca5-e5a2-7f80-9261-445a8cecd4d7/source.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://flakehub.com/f/numtide/flake-utils/0.1.%2A.tar.gz" - } - }, - "home-manager": { - "inputs": { - "nixpkgs": [ - "chaotic", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1714679908, - "narHash": "sha256-KzcXzDvDJjX34en8f3Zimm396x6idbt+cu4tWDVS2FI=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "9036fe9ef8e15a819fa76f47a8b1f287903fb848", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, - "jovian": { - "inputs": { - "nix-github-actions": "nix-github-actions", - "nixpkgs": [ - "chaotic", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1714720101, - "narHash": "sha256-Dxlj52coLzQZVV4a9IMMc/2xU5FIpj0iaHBigPwoNjM=", - "owner": "Jovian-Experiments", - "repo": "Jovian-NixOS", - "rev": "68b6bfacf67fcb1660c024b8dcd9376af38bbafe", - "type": "github" - }, - "original": { - "owner": "Jovian-Experiments", - "repo": "Jovian-NixOS", - "type": "github" - } - }, - "jujutsu": { - "inputs": { - "flake-utils": [ - "chaotic", - "flake-utils" - ], - "nixpkgs": [ - "chaotic", - "nixpkgs" - ], - "rust-overlay": "rust-overlay" - }, - "locked": { - "lastModified": 1714717012, - "narHash": "sha256-NBwvJqxD0JE7qhy6yZVyunrxAj8j8pn3XiFQxO2YOWI=", - "owner": "martinvonz", - "repo": "jj", - "rev": "0d630ac1bce0a87cf54a084c17a84225caa5fd6e", - "type": "github" - }, - "original": { - "owner": "martinvonz", - "repo": "jj", - "type": "github" - } - }, - "niri": { - "inputs": { - "crane": [ - "chaotic", - "crane" - ], - "fenix": [ - "chaotic", - "fenix" - ], - "flake-utils": [ - "chaotic", - "flake-utils" - ], - "nix-filter": [ - "chaotic", - "nix-filter" - ], - "nixpkgs": [ - "chaotic", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1714729593, - "narHash": "sha256-qJyx6NFn/aDrZ06WzJoi2irDyKrApMjDjKJ6UTkLD10=", - "owner": "YaLTeR", - "repo": "niri", - "rev": "85680a57dac965973644e9e96159716c0608bb57", - "type": "github" - }, - "original": { - "owner": "YaLTeR", - "repo": "niri", - "type": "github" - } - }, - "nix-filter": { - "locked": { - "lastModified": 1710156097, - "narHash": "sha256-1Wvk8UP7PXdf8bCCaEoMnOT1qe5/Duqgj+rL8sRQsSM=", - "owner": "numtide", - "repo": "nix-filter", - "rev": "3342559a24e85fc164b295c3444e8a139924675b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "nix-filter", - "type": "github" - } - }, - "nix-github-actions": { - "inputs": { - "nixpkgs": [ - "chaotic", - "jovian", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1690328911, - "narHash": "sha256-fxtExYk+aGf2YbjeWQ8JY9/n9dwuEt+ma1eUFzF8Jeo=", - "owner": "zhaofengli", - "repo": "nix-github-actions", - "rev": "96df4a39c52f53cb7098b923224d8ce941b64747", - "type": "github" - }, - "original": { - "owner": "zhaofengli", - "ref": "matrix-name", - "repo": "nix-github-actions", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1714906307, - "narHash": "sha256-UlRZtrCnhPFSJlDQE7M0eyhgvuuHBTe1eJ9N9AQlJQ0=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "25865a40d14b3f9cf19f19b924e2ab4069b09588", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1711460390, - "narHash": "sha256-akSgjDZL6pVHEfSE6sz1DNSXuYX6hq+P/1Z5IoYWs7E=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "44733514b72e732bd49f5511bd0203dea9b9a434", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-23.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "rocksdb": { - "flake": false, - "locked": { - "lastModified": 1713810944, - "narHash": "sha256-/Xf0bzNJPclH9IP80QNaABfhj4IAR5LycYET18VFCXc=", - "owner": "facebook", - "repo": "rocksdb", - "rev": "6f7cabeac80a3a6150be2c8a8369fcecb107bf43", - "type": "github" - }, - "original": { - "owner": "facebook", - "ref": "v9.1.1", - "repo": "rocksdb", - "type": "github" - } - }, - "root": { - "inputs": { - "chaotic": "chaotic", - "nixpkgs": "nixpkgs" - } - }, - "rust-analyzer-src": { - "flake": false, - "locked": { - "lastModified": 1714501997, - "narHash": "sha256-g31zfxwUFzkPgX0Q8sZLcrqGmOxwjEZ/iqJjNx4fEGo=", - "owner": "rust-lang", - "repo": "rust-analyzer", - "rev": "49e502b277a8126a9ad10c802d1aaa3ef1a280ef", - "type": "github" - }, - "original": { - "owner": "rust-lang", - "ref": "nightly", - "repo": "rust-analyzer", - "type": "github" - } - }, - "rust-overlay": { - "inputs": { - "flake-utils": [ - "chaotic", - "jujutsu", - "flake-utils" - ], - "nixpkgs": [ - "chaotic", - "jujutsu", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1707444620, - "narHash": "sha256-P8kRkiJLFttN+hbAOlm11wPxUrQZqKle+QtVCqFiGXY=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "78503e9199010a4df714f29a4f9c00eb2ccae071", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "systems": { - "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", - "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default-linux", - "type": "github" - } - }, - "yafas": { - "inputs": { - "flake-schemas": [ - "chaotic", - "flake-schemas" - ], - "systems": [ - "chaotic", - "systems" - ] - }, - "locked": { - "lastModified": 1695926485, - "narHash": "sha256-wNFFnItckgSs8XeYhhv8vlJs2WF09fSQaWgw4xkDqHQ=", - "rev": "7772afd6686458ca0ddbc599a52cf5d337367653", - "revCount": 4, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/UbiqueLambda/yafas/0.1.4%2Brev-7772afd6686458ca0ddbc599a52cf5d337367653/018add18-ebb4-72c6-93fe-d1d8da361703/source.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://flakehub.com/f/UbiqueLambda/yafas/0.1.%2A.tar.gz" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flake.nix b/flake.nix deleted file mode 100644 index bd8183e..0000000 --- a/flake.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ - description = "grimmauld-nixos"; - - inputs = { - nixpkgs = { - url = "github:NixOS/nixpkgs/nixos-unstable"; - # url = "git+file:///home/grimmauld/coding/nixpkgs"; - }; - chaotic = { - url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; - - outputs = inputs @ { self, nixpkgs, chaotic, ... }: - let - patches = [ - { - # tlpui - url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/305278.patch"; - hash = "sha256-vmzj7gF8jwHdqxN+dQiJ4MRxKpHvBTzbrUvFgt1DK8I="; - } - ]; - - customNixosSystem = system: definitions: - let - unpatched = nixpkgs.legacyPackages.${system}; - patched = unpatched.applyPatches { - name = "nixpkgs-patched"; - src = inputs.nixpkgs; - patches = map unpatched.fetchpatch patches; - }; - nixosSystem = import (patched + "/nixos/lib/eval-config.nix"); - in - nixosSystem ({ - inherit system; - specialArgs = { inherit inputs system; }; - } // definitions); - in - { - nixosConfigurations = { - grimmauld-nixos = customNixosSystem "x86_64-linux" { - modules = [ - # chaotic.nixosModules.default - ./configuration.nix - ]; - }; - }; - }; -} diff --git a/modules/system-packages.nix b/modules/system-packages.nix deleted file mode 100644 index afb1603..0000000 --- a/modules/system-packages.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs, lib, ... }: { - environment.systemPackages = with pkgs; [ - oci-cli - (writeShellScriptBin "rebuild" "bash -c \"nixos-rebuild switch --flake . |& nom\"") - ]; -} diff --git a/sway/default.nix b/sway/default.nix index 4fcb64a..7b2ea7d 100644 --- a/sway/default.nix +++ b/sway/default.nix @@ -1,4 +1,4 @@ -{ system, pkgs, config, lib, ... }: +{ pkgs, config, lib, ... }: let searchclip = let inherit (lib) getExe; in with pkgs; writeShellScriptBin "searchclip" '' xdg-open https://www.google.com/search?q=$(wl-paste -p | ${getExe urlencode})