From 341a41c63e33308ddb2e6fa43d6c949df39aca3f Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Mon, 11 Nov 2024 20:00:58 +0100 Subject: [PATCH] remove parts dir --- .envrc | 1 - flake.nix | 2 +- hosts/hermit/configuration.nix | 2 -- hosts/temperance/configuration.nix | 4 --- modules/style/quickshell/module.nix | 34 +++++++++--------- modules/user/helix/default.nix | 2 +- parts/default.nix | 7 ---- parts/fmt.nix | 37 ------------------- parts/lib/builders.nix | 47 ------------------------ parts/lib/default.nix | 56 ----------------------------- parts/lib/modules.nix | 44 ----------------------- parts/lib/systemd.nix | 0 parts/shell.nix | 24 ------------- parts/templates/default.nix | 8 ----- 14 files changed, 19 insertions(+), 249 deletions(-) delete mode 100644 parts/default.nix delete mode 100644 parts/fmt.nix delete mode 100644 parts/lib/builders.nix delete mode 100644 parts/lib/default.nix delete mode 100644 parts/lib/modules.nix delete mode 100644 parts/lib/systemd.nix delete mode 100644 parts/shell.nix delete mode 100644 parts/templates/default.nix diff --git a/.envrc b/.envrc index 8019600..1a36269 100644 --- a/.envrc +++ b/.envrc @@ -1,7 +1,6 @@ watch_file flake.nix watch_dir hosts -watch_dir parts use flake diff --git a/flake.nix b/flake.nix index 823037b..fe9e3b0 100644 --- a/flake.nix +++ b/flake.nix @@ -14,7 +14,7 @@ apps.x86_64-linux = { default = { type = "app"; - program = pkgs.getExe user.packages.fish; + program = "${user.packages.fish}/bin/fish"; }; helix = { type = "app"; diff --git a/hosts/hermit/configuration.nix b/hosts/hermit/configuration.nix index c0b5510..54dff78 100644 --- a/hosts/hermit/configuration.nix +++ b/hosts/hermit/configuration.nix @@ -79,14 +79,12 @@ }; other = { system.username = "cr"; - }; programs = { ssh.enable = true; btop.enable = true; nh.enable = true; }; - }; system.stateVersion = "23.11"; } diff --git a/hosts/temperance/configuration.nix b/hosts/temperance/configuration.nix index 8118854..52be064 100644 --- a/hosts/temperance/configuration.nix +++ b/hosts/temperance/configuration.nix @@ -70,7 +70,6 @@ in { desktops.hyprland.enable = true; programs = { - media = { beets.enable = true; mpv.enable = true; @@ -87,19 +86,16 @@ in { musicDirectory = "/home/${config.modules.other.system.username}/cloud/media/Music"; }; }; - }; other = { system = { username = "cr"; }; - }; programs = { ssh.enable = true; btop.enable = true; nh.enable = true; }; - }; } diff --git a/modules/style/quickshell/module.nix b/modules/style/quickshell/module.nix index 80b7e3f..84165bd 100644 --- a/modules/style/quickshell/module.nix +++ b/modules/style/quickshell/module.nix @@ -5,22 +5,22 @@ pkgs, ... }: let -# inherit (inputs) quickshell; -# inherit (lib.generators) toKeyValue; + # inherit (inputs) quickshell; + # inherit (lib.generators) toKeyValue; in { -# environment.systemPackages = with pkgs; [ -# qt6.qtimageformats # amog -# qt6.qt5compat # shader fx -# (quickshell.packages.x86_64-linux.default.override { -# withJemalloc = true; -# withQtSvg = true; -# withX11 = true; -# withPipewire = true; -# withPam = true; -# withHyprland = true; -# }) -# pamtester # lockscreen -# grim -# imagemagick # screenshot -# ]; + # environment.systemPackages = with pkgs; [ + # qt6.qtimageformats # amog + # qt6.qt5compat # shader fx + # (quickshell.packages.x86_64-linux.default.override { + # withJemalloc = true; + # withQtSvg = true; + # withX11 = true; + # withPipewire = true; + # withPam = true; + # withHyprland = true; + # }) + # pamtester # lockscreen + # grim + # imagemagick # screenshot + # ]; } diff --git a/modules/user/helix/default.nix b/modules/user/helix/default.nix index 2092c4b..a34eef5 100644 --- a/modules/user/helix/default.nix +++ b/modules/user/helix/default.nix @@ -5,7 +5,7 @@ gdb, black, cmake-format, - tinymist, + tinymist, lib, marksman, lldb_19, diff --git a/parts/default.nix b/parts/default.nix deleted file mode 100644 index 0f4c6c0..0000000 --- a/parts/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - imports = [ - ./shell.nix - ./templates - ./lib - ]; -} diff --git a/parts/fmt.nix b/parts/fmt.nix deleted file mode 100644 index 37e2bf0..0000000 --- a/parts/fmt.nix +++ /dev/null @@ -1,37 +0,0 @@ -{inputs, ...}: { - imports = [inputs.treefmt-nix.flakeModule]; - perSystem = { - config, - pkgs, - ... - }: { - # https://github.com/numtide/treefmt-nix?tab=readme-ov-file#flake-parts - formatter = config.treefmt.build.wrapper; - - treefmt = { - projectRootFile = "flake.nix"; - enableDefaultExcludes = true; - settings = { - global.excludes = ["*.png"]; - }; - programs = { - # alejandro - alejandra.enable = true; - - shellcheck.enable = true; - - prettier = { - enable = true; - package = pkgs.prettierd; - settings.editorconfig = true; - }; - - shfmt = { - enable = true; - # https://flake.parts/options/treefmt-nix.html#opt-perSystem.treefmt.programs.shfmt.indent_size - indent_size = 2; # set to 0 to use tabs - }; - }; - }; - }; -} diff --git a/parts/lib/builders.nix b/parts/lib/builders.nix deleted file mode 100644 index 7cdb9eb..0000000 --- a/parts/lib/builders.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ - inputs, - lib, - ... -}: let - inherit (inputs) self; - inherit (lib) mkDefault nixosSystem recursiveUpdate; - inherit (lib.lists) singleton concatLists; - - mkSystem = { - withSystem, - system, - hostname, - ... - } @ args: - withSystem system ( - { - inputs', - self', - ... - }: - nixosSystem { - inherit system; - specialArgs = - recursiveUpdate - { - inherit lib; - inherit inputs inputs'; - inherit self self'; - } - (args.specialArgs or {}); - modules = concatLists [ - # This is used to pre-emptively set the hostPlatform for nixpkgs. - # Also, we set the system hostname here. - (singleton { - networking.hostName = args.hostname; - nixpkgs.hostPlatform = mkDefault args.system; - }) - - # We pass our modules from the arguments - (args.modules or []) - ]; - } - ); -in { - inherit mkSystem; -} diff --git a/parts/lib/default.nix b/parts/lib/default.nix deleted file mode 100644 index 747b54e..0000000 --- a/parts/lib/default.nix +++ /dev/null @@ -1,56 +0,0 @@ -{inputs, ...}: let - inherit (inputs.nixpkgs) lib; - - # Define the base library to be extended. Not only will this be an extension - # of the nixpkgs library, but it will also be extensible the way nixpkgs lib - # is in case the extended library - # 1. needs to be extended internally - # 2. needs to be extended during outside consumption - # Additionally, .extend can be used to extend the lib with - # custom, composed functions. - lib0 = self: let - callLibs = file: - import file { - inherit inputs; - lib = self; - }; - in { - extendedLib = { - builders = callLibs ./builders.nix; - modules = callLibs ./modules.nix; - }; - - # This makes mkSytem available *in addition* to `lib.extendedLib.builders.mkSystem`. - # The syntax is a matter of preference, but it is good to make sure all custom attribute - # sets (e.g., builders) are defined and taken from a separate attrset (extendedLib) to make - # absolutely sure we *never* conflict with nixpkgs. Likewise, the function names inherited - # here should also be different from ones available under `lib` by default, i.e., you cannot - # re-define functions. - # inherit (self.extendedLib) builders; - # inherit (self.extendedLib.builders) mkSystem; - }; - # Merge layers of libraries into one as a subject of convenience - # and easy access. - extensions = lib.composeManyExtensions [ - (_: _: inputs.nixpkgs.lib) - (_: _: inputs.flake-parts.lib) - ]; - - # Extend default library - extendedLib = (lib.makeExtensible lib0).extend extensions; - # This can be used with `.extend` to extend the extended library. -in { - # Set the `lib` argument in `perSystem`, for example: - # ``` - # perSystem = {pkgs, lib, ...}: { ...} - # ```` - perSystem._module.args.lib = extendedLib; - - # Prepare `lib` for external usage. This means it can be consumed - # from inputs.` by other flakes. - # `self` can also be used to access the custom lib as long as - # `flake.lib` is set. - flake = { - lib = extendedLib; - }; -} diff --git a/parts/lib/modules.nix b/parts/lib/modules.nix deleted file mode 100644 index 3ef4b75..0000000 --- a/parts/lib/modules.nix +++ /dev/null @@ -1,44 +0,0 @@ -{lib, ...}: let - inherit (builtins) filter map toString elem; - inherit (lib.filesystem) listFilesRecursive; - inherit (lib.strings) hasSuffix; - - # NOTE: This was bluntly taken from raf. - - # `mkModuleTree` is used to recursively import all Nix file in a given directory, assuming the - # given directory to be the module root, where rest of the modules are to be imported. This - # retains a sense of explicitness in the module tree, and allows for a more organized module - # imports, discarding the vague `default.nix` name for directories that are *modules*. - mkModuleTree = { - path, - ignoredPaths ? [./default.nix], - }: - filter (hasSuffix ".nix") ( - map toString ( - # List all files in the given path, and filter out paths that are in - # the ignoredPaths list - filter (path: !elem path ignoredPaths) (listFilesRecursive path) - ) - ); - - # A variant of mkModuleTree that provides more granular control over the files that are imported. - # While `mkModuleTree` imports all Nix files in the given directory, `mkModuleTree'` will look - # for a specific - mkModuleTree' = { - path, - ignoredPaths ? [], - }: ( - # Two conditions fill satisfy filter here: - # - The path should end with a module.nix, indicating - # that it is in fact a module file. - # - The path is not contained in the ignoredPaths list. - # If we cannot satisfy both of the conditions, then the path will be ignored - filter (hasSuffix "module.nix") ( - map toString ( - filter (path: !elem path ignoredPaths) (listFilesRecursive path) - ) - ) - ); -in { - inherit mkModuleTree mkModuleTree'; -} diff --git a/parts/lib/systemd.nix b/parts/lib/systemd.nix deleted file mode 100644 index e69de29..0000000 diff --git a/parts/shell.nix b/parts/shell.nix deleted file mode 100644 index c0184f0..0000000 --- a/parts/shell.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - perSystem = { - config, - pkgs, - ... - }: { - devShells.default = pkgs.mkShellNoCC { - name = "nichts"; - - DIRENV_LOG_FORMAT = ""; - - packages = [ - pkgs.git # take a guess - - (pkgs.writeShellApplication { - name = "update"; - text = '' - nix flake update && git commit flake.lock -m "flake: bump inputs" - ''; - }) - ]; - }; - }; -} diff --git a/parts/templates/default.nix b/parts/templates/default.nix deleted file mode 100644 index 6791279..0000000 --- a/parts/templates/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -_: { - flake.templates = { - # somelang = { - # path = ./somelang; - # description = "QuickShell developement flake"; - # }; - }; -}