summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseth <[email protected]>2023-02-25 09:11:50 -0500
committerseth <[email protected]>2023-02-25 09:11:50 -0500
commit83effef025bca97e57e20a0453a9c5e76e38ea9b (patch)
treefeffe69be62e8938183c1a8fb0768519a16ee3d8
parent33d7a86e253d0f267e86fc48764ef4d5780b4c95 (diff)
support nix fmt on all platforms
-rw-r--r--flake.nix9
-rw-r--r--users/seth/shell/bash.nix15
-rw-r--r--users/seth/shell/fish.nix25
3 files changed, 35 insertions, 14 deletions
diff --git a/flake.nix b/flake.nix
index 034b9b7..3bba09e 100644
--- a/flake.nix
+++ b/flake.nix
@@ -18,6 +18,9 @@
nixpkgsUnstable,
...
}: let
+ supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
+ forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
+ nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;});
util = import ./util {inherit inputs home-manager;};
inherit (util) host user;
in {
@@ -46,7 +49,7 @@
];
specialArgs = {
desktop = "gnome";
- standalone = true;
+ standalone = false;
wsl = false;
};
version = "23.05";
@@ -72,13 +75,13 @@
];
specialArgs = {
desktop = "";
- standalone = true;
+ standalone = false;
wsl = true;
};
version = "23.05";
pkgs = nixpkgsUnstable;
});
- formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
+ formatter = forAllSystems (system: nixpkgsFor.${system}.alejandra);
};
}
diff --git a/users/seth/shell/bash.nix b/users/seth/shell/bash.nix
index bdc2fe1..b3a1257 100644
--- a/users/seth/shell/bash.nix
+++ b/users/seth/shell/bash.nix
@@ -1,9 +1,16 @@
-{config, standalone, ...}: {
+{
+ config,
+ standalone,
+ ...
+}: {
programs.bash = {
enable = true;
- bashrcExtra = if standalone then ''
- . ${config.home.homeDirectory}/.nix-profile/etc/profile.d/nix.sh
- '' else '''';
+ bashrcExtra =
+ if standalone
+ then ''
+ . ${config.home.homeDirectory}/.nix-profile/etc/profile.d/nix.sh
+ ''
+ else '''';
historyFile = "${config.xdg.stateHome}/bash/history";
historyFileSize = 1000;
historySize = 100;
diff --git a/users/seth/shell/fish.nix b/users/seth/shell/fish.nix
index 09b7b42..c138db5 100644
--- a/users/seth/shell/fish.nix
+++ b/users/seth/shell/fish.nix
@@ -1,4 +1,9 @@
-{config, pkgs, standalone, ...}: {
+{
+ config,
+ pkgs,
+ standalone,
+ ...
+}: {
xdg.configFile."fish/themes" = {
recursive = true;
source =
@@ -14,12 +19,18 @@
programs.fish = {
enable = true;
- interactiveShellInit = ''
- fish_config theme choose "Catppuccin Mocha"
- direnv hook fish | source
- '' + (if standalone then ''
- . ${config.home.homeDirectory}/.nix-profile/etc/profile.d/nix.fish
- '' else '''');
+ interactiveShellInit =
+ ''
+ fish_config theme choose "Catppuccin Mocha"
+ direnv hook fish | source
+ ''
+ + (
+ if standalone
+ then ''
+ . ${config.home.homeDirectory}/.nix-profile/etc/profile.d/nix.fish
+ ''
+ else ''''
+ );
plugins = [
{
name = "autopair-fish";