Skip to content

Commit

Permalink
Add nixfmt as flake formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
Sigmanificient committed Aug 21, 2023
1 parent a0b568a commit 4813a15
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 22 deletions.
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
username = "sigmanificient";
system = "x86_64-linux";

pkgs = nixpkgs.legacyPackages.${system};

default_modules = [
nix-index-database.nixosModules.nix-index

Expand All @@ -57,6 +59,8 @@

in
{
formatter.${system} = pkgs.nixpkgs-fmt;

nixosConfigurations = {
Bacon = nixpkgs.lib.nixosSystem {
inherit system;
Expand Down
2 changes: 1 addition & 1 deletion home/nvim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let
clang-tools
llvmPackages_latest.clang
nodejs # Copilot
xclip # Clipboard fix
xclip # Clipboard fix
];

extra_pkgs =
Expand Down
41 changes: 21 additions & 20 deletions home/qtile/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,27 @@

outputs = { self, nixpkgs, utils }:
utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
py = pkgs.python311;
in {
devShells.default = pkgs.mkShell {
buildInputs = with py.pkgs; [
black
isort
qtile
];
};
let
pkgs = nixpkgs.legacyPackages.${system};
py = pkgs.python311;
in
{
devShells.default = pkgs.mkShell {
buildInputs = with py.pkgs; [
black
isort
qtile
];
};

formatter = pkgs.nixpkgs-fmt;
packages = rec {
qtile-reset = (pkgs.writeShellScriptBin "qtile-reset" ''
find ~/.config/qtile -type d -name "__pycache__" | xargs rm -rf {} +
pkill -SIGUSR1 .qtile-wrapped
'');
formatter = pkgs.nixpkgs-fmt;
packages = rec {
qtile-reset = (pkgs.writeShellScriptBin "qtile-reset" ''
find ~/.config/qtile -type d -name "__pycache__" | xargs rm -rf {} +
pkill -SIGUSR1 .qtile-wrapped
'');

default = qtile-reset;
};
});
default = qtile-reset;
};
});
}
2 changes: 1 addition & 1 deletion home/qtile/shell.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
with import <nixpkgs> {};
with import <nixpkgs> { };
mkShell {
name = "pip-env";
buildInputs = with python3.pkgs; [
Expand Down

0 comments on commit 4813a15

Please sign in to comment.