From a36664a3902884cbb4c71a96e2ab2e9ff145263a Mon Sep 17 00:00:00 2001 From: RGBCube Date: Wed, 10 May 2023 21:20:32 +0300 Subject: [PATCH] Cleanup --- .gitignore | 4 ---- flake.nix | 16 +++++++--------- machines/asus/neovim/config/init.lua | 1 - machines/asus/neovim/default.nix | 8 ++++++-- machines/asus/nixpkgs/packages.nix | 5 ++++- packages/nvchad/default.nix | 20 -------------------- 6 files changed, 17 insertions(+), 37 deletions(-) delete mode 100644 machines/asus/neovim/config/init.lua delete mode 100644 packages/nvchad/default.nix diff --git a/.gitignore b/.gitignore index 58b61a1..550c514 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,6 @@ !machines/asus/docker/ !machines/asus/git/ !machines/asus/neovim/ -!machines/asus/neovim/config/ !machines/asus/neovim/nvchad/ !machines/asus/networkmanager/ !machines/asus/nixpkgs/ @@ -15,9 +14,6 @@ !machines/asus/system/ !machines/asus/xserver/ -!packages/ -!packages/nvchad/ - !flake.lock !.editorconfig !.gitignore diff --git a/flake.nix b/flake.nix index 7592ced..6f0ec68 100644 --- a/flake.nix +++ b/flake.nix @@ -43,26 +43,24 @@ system = hostPlatform; config.allowUnfree = true; - overlays = [fenix.overlays.default]; + overlays = [ + fenix.overlays.default + ]; }; - # Helper functiona for DRY. + # Helper function for DRY. homeManagerConfiguration = userName: attrs: { home-manager.users.${userName} = attrs; }; - homeManagerConfigurationWithArgs = userName: attrsFunc: { - home-manager.users.${userName} = args: attrsFunc args; - }; - - # Q: Can't we just do "./foo" ? + # Q: Can't we just do supply a relative path "./foo" ? # A: When configuring our system with flakes, Nix copies them to the # Nix store to run them. So we can't use relative paths as they will refer # to a file which is in the Nix store, and is immutable because it is in # the Nix store, which beats the point of abusing Home Managers # mkOutOfStoreSymlink to create symlinks to mutable files. # To avoid this, we must give an absolute path to a file, - # so we do this. The $PWD is replaced by the rebuild script + # so we do this. The @pwd@ here is replaced by the rebuild script # with the working directory, then changed back after the build. # And yes, this is a major hack. projectPath = "@pwd@"; @@ -90,6 +88,6 @@ }; builtins.foldl' nixpkgs.lib.recursiveUpdate {} (builtins.map importConfiguration [ - ./machines/asus # HACK: Use a function to list the directory. + ./machines/asus ]); } diff --git a/machines/asus/neovim/config/init.lua b/machines/asus/neovim/config/init.lua deleted file mode 100644 index 2126a4a..0000000 --- a/machines/asus/neovim/config/init.lua +++ /dev/null @@ -1 +0,0 @@ --- TODO diff --git a/machines/asus/neovim/default.nix b/machines/asus/neovim/default.nix index 06cb201..4007e78 100644 --- a/machines/asus/neovim/default.nix +++ b/machines/asus/neovim/default.nix @@ -1,14 +1,18 @@ -{ pkgs, lib, homeManagerConfigurationWithArgs, projectPath, ... }: +{ pkgs, lib, homeManagerConfiguration, projectPath, ... }: { # Nuking nano out of orbit. environment.defaultPackages = []; programs.nano.syntaxHighlight = false; + + environment.systemPackages = with pkgs; [ + neovim-qt + ]; } // -(homeManagerConfigurationWithArgs "nixos" ({ config, ... }: { +(homeManagerConfiguration "nixos" ({ config, ... }: { programs.neovim.enable = true; programs.neovim = { # Does not work with Nushell for some reason, I just set it manually. diff --git a/machines/asus/nixpkgs/packages.nix b/machines/asus/nixpkgs/packages.nix index 9cc1ece..5061d1d 100644 --- a/machines/asus/nixpkgs/packages.nix +++ b/machines/asus/nixpkgs/packages.nix @@ -11,7 +11,6 @@ pkgs: with pkgs; [] ] ++ [ # EDITORS - neovim-qt jetbrains.idea-ultimate ] @@ -19,6 +18,10 @@ pkgs: with pkgs; [] wine ] +++ [ # FIRMWARE + linux-firmware +] + ++ [ # GAMES openttd ] diff --git a/packages/nvchad/default.nix b/packages/nvchad/default.nix deleted file mode 100644 index 864daef..0000000 --- a/packages/nvchad/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ stdenvNoCC, fetchFromGitHub, ...}: - -stdenvNoCC.mkDerivation rec { - name = "nvchad"; - version = "2.0"; - - src = fetchFromGitHub { - owner = "NvChad"; - repo = "NvChad"; - rev = "refs/heads/v${version}"; - sha256 = "sha256-bfDNMy4pjdSwYAjyhN09fGLJguoooJAQm1nKneCpKcU="; - }; - - preferLocalBuild = true; - - installPhase = '' - mkdir -p $out - cp -r ./ $out - ''; -}