run nixfmt on repo

This commit is contained in:
Salar Rahmanian 2024-05-18 11:31:35 -07:00
parent 29c4ce7acd
commit 276ceac3d5
6 changed files with 93 additions and 85 deletions

View file

@ -1,4 +1 @@
{ { allowUnfree = true; }
allowUnfree = true;
}

View file

@ -7,63 +7,75 @@
url = "github:LnL7/nix-darwin"; url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nur.url = github:nix-community/nur; nur.url = "github:nix-community/nur";
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = { self, nix-darwin, home-manager, nur, nixpkgs, ... }: outputs =
{
self,
nix-darwin,
home-manager,
nur,
nixpkgs,
...
}:
let let
homeManagerConfFor = config: { ... }: { homeManagerConfFor =
nixpkgs.overlays = [ nur.overlay ]; config:
imports = [ config ]; { ... }:
}; {
nixpkgs.overlays = [ nur.overlay ];
m3maxConfiguration = { pkgs, ... }: { imports = [ config ];
environment.systemPackages = with pkgs;
[
home-manager
];
fonts = {
fontDir.enable = true;
fonts = with pkgs; [
fira-code
];
}; };
services.nix-daemon.enable = true; m3maxConfiguration =
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [ home-manager ];
nix = { fonts = {
nixPath = nixpkgs.lib.mkForce [ fontDir.enable = true;
"nixpkgs=${nixpkgs}" fonts = with pkgs; [ fira-code ];
];
package = pkgs.nixFlakes;
settings = {
experimental-features = "nix-command flakes";
extra-platforms = [ "x86_64-darwin" "aarch64-darwin" ];
trusted-users = [ "root" "salar" ];
}; };
distributedBuilds = false;
};
programs.fish.enable = true; services.nix-daemon.enable = true;
system.configurationRevision = self.rev or self.dirtyRev or null; nix = {
nixPath = nixpkgs.lib.mkForce [ "nixpkgs=${nixpkgs}" ];
system.stateVersion = 4; package = pkgs.nixFlakes;
settings = {
experimental-features = "nix-command flakes";
extra-platforms = [
"x86_64-darwin"
"aarch64-darwin"
];
trusted-users = [
"root"
"salar"
];
};
distributedBuilds = false;
};
nixpkgs.hostPlatform = "aarch64-darwin"; programs.fish.enable = true;
users = { system.configurationRevision = self.rev or self.dirtyRev or null;
users.salar = {
home = /Users/salar; system.stateVersion = 4;
nixpkgs.hostPlatform = "aarch64-darwin";
users = {
users.salar = {
home = /Users/salar;
};
}; };
}; };
};
in in
{ {
darwinConfigurations.salarm3max = nix-darwin.lib.darwinSystem { darwinConfigurations.salarm3max = nix-darwin.lib.darwinSystem {
@ -76,7 +88,9 @@
home-manager.users.salar = homeManagerConfFor ./home.nix; home-manager.users.salar = homeManagerConfFor ./home.nix;
} }
]; ];
specialArgs = { inherit nixpkgs; }; specialArgs = {
inherit nixpkgs;
};
}; };
darwinPackages = self.darwinConfigurations.salarm3max.pkgs; darwinPackages = self.darwinConfigurations.salarm3max.pkgs;

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
{ {
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
@ -6,13 +11,15 @@
imports = (import ./programs); imports = (import ./programs);
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ nixpkgs.config.allowUnfreePredicate =
"discord" pkg:
"slack" builtins.elem (lib.getName pkg) [
"vscode" "discord"
"vscode-extension-MS-python-vscode-pylance" "slack"
"zoom" "vscode"
]; "vscode-extension-MS-python-vscode-pylance"
"zoom"
];
home = { home = {
stateVersion = "23.11"; stateVersion = "23.11";
@ -54,7 +61,7 @@
neovim neovim
niv niv
nix-index nix-index
nixfmt nixfmt-rfc-style
nix-prefetch-git nix-prefetch-git
nodejs nodejs
nodePackages.pyright nodePackages.pyright
@ -110,9 +117,7 @@
programs.darcs = { programs.darcs = {
enable = true; enable = true;
author = [ author = [ "Salar Rahmanian <code@softinio.com>" ];
"Salar Rahmanian <code@softinio.com>"
];
boring = [ boring = [
"^.idea$" "^.idea$"
"^.direnv$" "^.direnv$"
@ -353,4 +358,3 @@
rev = "12c5e919e829c067ba795fe7f1e02037cbc0b4e9"; rev = "12c5e919e829c067ba795fe7f1e02037cbc0b4e9";
}; };
} }

View file

@ -4,7 +4,7 @@ let
gitConfig = { gitConfig = {
core = { core = {
editor = "nvim"; editor = "nvim";
pager = "diff-so-fancy | less --tabs=4 -RFX"; pager = "diff-so-fancy | less --tabs=4 -RFX";
}; };
init.defaultBranch = "main"; init.defaultBranch = "main";
merge.conflictstyle = "diff3"; merge.conflictstyle = "diff3";
@ -36,22 +36,22 @@ let
master = "checkout master"; master = "checkout master";
}; };
myIgnores = [ myIgnores = [
"*~" "*~"
".DS_Store" ".DS_Store"
"*.bloop" "*.bloop"
".direnv/" ".direnv/"
".idea/" ".idea/"
".mypy_cache" ".mypy_cache"
"*.metals" "*.metals"
"*.metals.sbt" "*.metals.sbt"
"*metals.sbt" "*metals.sbt"
"*.envrc" # there is lorri, nix-direnv & simple direnv; let people decide "*.envrc" # there is lorri, nix-direnv & simple direnv; let people decide
"*hie.yaml" # ghcide files "*hie.yaml" # ghcide files
"*.mill-version" # used by metals "*.mill-version" # used by metals
"*.vscode" "*.vscode"
"*.python-version" "*.python-version"
"result" "result"
]; ];
in in
{ {
programs.git = { programs.git = {

View file

@ -22,16 +22,9 @@ in
plugin = tmuxPlugins.continuum; plugin = tmuxPlugins.continuum;
extraConfig = "set -g @continuum-restore 'on'"; extraConfig = "set -g @continuum-restore 'on'";
} }
{ { plugin = tmuxPlugins.sensible; }
plugin = tmuxPlugins.sensible; { plugin = tmuxPlugins.vim-tmux-navigator; }
} { plugin = tmuxPlugins.onedark-theme; }
{
plugin = tmuxPlugins.vim-tmux-navigator;
}
{
plugin = tmuxPlugins.onedark-theme;
}
]; ];
}; };
} }