diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 74e1765..ca3668e 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -3,7 +3,6 @@ "pinage404.nix-extension-pack", "bbenoist.nix", "jnoortheen.nix-ide", - "kamadorueda.alejandra", "mkhl.direnv", "dlasagno.rasi", "jgclark.vscode-todo-highlight", diff --git a/.vscode/settings.json b/.vscode/settings.json index 7f75e04..11da51d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,7 +4,9 @@ "nix.serverSettings": { "nixd": { "formatting": { - "command": ["alejandra"], + "command": [ + "nixfmt" + ], }, "nixpkgs": { "expr": "import { }" @@ -19,18 +21,18 @@ "[nix]": { "editor.insertSpaces": true, "editor.tabSize": 2, - "editor.defaultFormatter": "kamadorueda.alejandra", + "editor.defaultFormatter": "jnoortheen.nix-ide", "editor.formatOnPaste": true, "editor.formatOnSave": true, "editor.formatOnType": false }, "cSpell.language": "en,pl,en-US", - "cSpell.enableFiletypes": [ - "markdown", - "nix", - "yaml", - "yml" - ], + "cSpell.enabledFileTypes": { + "markdown": true, + "nix": true, + "yaml": true, + "yml": true + }, "cSpell.words": [ "aagl", "ahci", diff --git a/flake.lock b/flake.lock index 3b312a7..7a4d65d 100644 --- a/flake.lock +++ b/flake.lock @@ -206,6 +206,26 @@ "type": "github" } }, + "nixfmt": { + "inputs": { + "flake-utils": [ + "flake-utils" + ] + }, + "locked": { + "lastModified": 1733346278, + "narHash": "sha256-MoO/hSWDPMKIUMJASuYo4N7ZTRp4P1ZmDJZbt5mk834=", + "owner": "NixOS", + "repo": "nixfmt", + "rev": "a4639036723e510d8331124c80d9ca14dd7aba02", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixfmt", + "type": "github" + } + }, "nixos-hardware": { "locked": { "lastModified": 1733217105, @@ -323,6 +343,7 @@ "flake-utils": "flake-utils", "home-manager": "home-manager", "nix-colors": "nix-colors", + "nixfmt": "nixfmt", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "nostale-dev-env": "nostale-dev-env", diff --git a/flake.nix b/flake.nix index e1ea0ee..fee722b 100644 --- a/flake.nix +++ b/flake.nix @@ -43,69 +43,78 @@ inputs.flake-utils.follows = "flake-utils"; inputs.nixpkgs.follows = "nixpkgs"; }; + nixfmt = { + url = "github:NixOS/nixfmt"; + inputs.flake-utils.follows = "flake-utils"; + }; }; - outputs = { - self, - nixpkgs, - home-manager, - ... - } @ flakeInputs: let - system = "x86_64-linux"; - username = "zakuciael"; + outputs = + { + self, + nixpkgs, + home-manager, + ... + }@flakeInputs: + let + system = "x86_64-linux"; + username = "zakuciael"; - pkgs = import inputs.nixpkgs { - inherit system; - config = { - allowUnfree = true; - permittedInsecurePackages = []; - }; + pkgs = import inputs.nixpkgs { + inherit system; + config = { + allowUnfree = true; + permittedInsecurePackages = [ ]; + }; - overlays = lib.my.overlays.pkgs ++ lib.singleton (inputs.aagl.overlays.default); - }; + overlays = lib.my.overlays.pkgs ++ lib.singleton (inputs.aagl.overlays.default); + }; - inputs = - flakeInputs - // { + inputs = flakeInputs // { distro-grub-themes = flakeInputs.distro-grub-themes.packages.${system}; rofi-jetbrains = flakeInputs.rofi-jetbrains.packages.${system}; - nostale-dev-env = - flakeInputs.nostale-dev-env - // {packages = flakeInputs.nostale-dev-env.packages.${system};}; - catppuccin = - flakeInputs.catppuccin - // { - homeManagerModule = flakeInputs.catppuccin.homeManagerModules.catppuccin; - nixosModules = - flakeInputs.catppuccin.nixosModules - // { - default = flakeInputs.catppuccin.nixosModules.catppuccin; - }; - }; - aagl = flakeInputs.aagl // {packages = flakeInputs.aagl.packages.${system};}; - vscode-server = - flakeInputs.vscode-server - // { - homeManagerModule = flakeInputs.vscode-server.homeModules.default; + nostale-dev-env = flakeInputs.nostale-dev-env // { + packages = flakeInputs.nostale-dev-env.packages.${system}; + }; + catppuccin = flakeInputs.catppuccin // { + homeManagerModule = flakeInputs.catppuccin.homeManagerModules.catppuccin; + nixosModules = flakeInputs.catppuccin.nixosModules // { + default = flakeInputs.catppuccin.nixosModules.catppuccin; }; + }; + aagl = flakeInputs.aagl // { + packages = flakeInputs.aagl.packages.${system}; + }; + vscode-server = flakeInputs.vscode-server // { + homeManagerModule = flakeInputs.vscode-server.homeModules.default; + }; + nixfmt = flakeInputs.nixfmt.packages.${system}; }; - lib = nixpkgs.lib.extend (self: super: { - hm = home-manager.lib.hm; - my = import ./lib { - inherit lib pkgs inputs username system; - }; - }); - in { - nixosConfigurations = let - inherit (lib.my.hosts) mkHost; - hosts = builtins.readDir ./hosts; - mappedHosts = builtins.mapAttrs (n: v: mkHost {name = n;}) hosts; + lib = nixpkgs.lib.extend ( + self: super: { + hm = home-manager.lib.hm; + my = import ./lib { + inherit + lib + pkgs + inputs + username + system + ; + }; + } + ); in - mappedHosts; + { + nixosConfigurations = + let + inherit (lib.my.hosts) mkHost; + in + builtins.readDir ./hosts |> builtins.mapAttrs (name: _: mkHost { inherit name; }); - devShells.${system}.default = pkgs.callPackage ./shell.nix {}; + devShells.${system}.default = pkgs.callPackage ./shell.nix { }; - inherit pkgs inputs lib; - }; + inherit pkgs inputs lib; + }; } diff --git a/modules/desktop/apps.nix b/modules/desktop/apps.nix index c15c677..e3a1fad 100644 --- a/modules/desktop/apps.nix +++ b/modules/desktop/apps.nix @@ -1,18 +1,12 @@ -{ - config, - lib, - pkgs, - inputs, - username, - ... -}: +{ config, lib, pkgs, inputs, username, ... }: with lib; -with builtins; let +with builtins; +let cfg = config.modules.desktop.apps; mkAutostartModules = programs: builtins.listToAttrs (builtins.map (desktop: { name = desktop; - value = {autostartPrograms = programs;}; + value = { autostartPrograms = programs; }; }) (builtins.attrNames config.modules.desktop.wm)); in { options.modules.desktop.apps = { @@ -27,7 +21,7 @@ in { home.packages = with pkgs; [ # Nix nixd - alejandra + inputs.nixfmt.default # Browser google-chrome