Skip to content

Commit

Permalink
chore(flake): replace alejandra with nixfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
zakuciael committed Dec 9, 2024
1 parent f66397b commit 772cf71
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 72 deletions.
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"pinage404.nix-extension-pack",
"bbenoist.nix",
"jnoortheen.nix-ide",
"kamadorueda.alejandra",
"mkhl.direnv",
"dlasagno.rasi",
"jgclark.vscode-todo-highlight",
Expand Down
18 changes: 10 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"nix.serverSettings": {
"nixd": {
"formatting": {
"command": ["alejandra"],
"command": [
"nixfmt"
],
},
"nixpkgs": {
"expr": "import <nixpkgs> { }"
Expand All @@ -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",
Expand Down
21 changes: 21 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

113 changes: 61 additions & 52 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
}
16 changes: 5 additions & 11 deletions modules/desktop/apps.nix
Original file line number Diff line number Diff line change
@@ -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 = {
Expand All @@ -27,7 +21,7 @@ in {
home.packages = with pkgs; [
# Nix
nixd
alejandra
inputs.nixfmt.default

# Browser
google-chrome
Expand Down

0 comments on commit 772cf71

Please sign in to comment.