From b6b5c8a1fc32d6e6f6eafed2e2d19ab1f256537c Mon Sep 17 00:00:00 2001 From: larstvei Date: Sun, 6 Oct 2024 21:53:29 +0200 Subject: [PATCH] Formatting --- flake.nix | 63 +++++++++++++++++++++++++++---------------- modules/core.nix | 25 +++++++++++------ modules/home.nix | 18 ++++++++++--- modules/languages.nix | 19 +++++++------ modules/macos.nix | 12 ++++++--- modules/tools.nix | 3 ++- 6 files changed, 94 insertions(+), 46 deletions(-) diff --git a/flake.nix b/flake.nix index ba833fc..ab7e38d 100644 --- a/flake.nix +++ b/flake.nix @@ -16,31 +16,48 @@ emacs-larstvei.url = "github:larstvei/emacs-flake"; }; - outputs = { self, nixpkgs, darwin, home-manager, emacs-larstvei, ... }@inputs: { - darwinConfigurations."larstvei-macbookpro" = darwin.lib.darwinSystem { - system = "aarch64-darwin"; + outputs = + { + self, + nixpkgs, + darwin, + home-manager, + emacs-larstvei, + ... + }@inputs: + { + darwinConfigurations."larstvei-macbookpro" = darwin.lib.darwinSystem { + system = "aarch64-darwin"; - modules = [ - ./modules/core.nix - ./modules/macos.nix + modules = [ + ./modules/core.nix + ./modules/macos.nix - home-manager.darwinModule - { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - users.larstvei = { - imports = [ - { _module.args = inputs; } # <- one could ask, why? - ./modules/home.nix - ]; + home-manager.darwinModule + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.larstvei = { + imports = [ + { _module.args = inputs; } # <- one could ask, why? + ./modules/home.nix + ]; + }; }; - }; - } - ({ config, pkgs, lib, ... }: { - services.nix-daemon.enable = true; - }) - ]; + } + ( + { + config, + pkgs, + lib, + ... + }: + { + services.nix-daemon.enable = true; + } + ) + ]; + }; }; - }; } diff --git a/modules/core.nix b/modules/core.nix index 4949fca..9280d9c 100644 --- a/modules/core.nix +++ b/modules/core.nix @@ -5,10 +5,19 @@ settings = { system = "aarch64-darwin"; - extra-platforms = [ "aarch64-darwin" "x86_64-darwin" ]; - experimental-features = [ "nix-command" "flakes" ]; + extra-platforms = [ + "aarch64-darwin" + "x86_64-darwin" + ]; + experimental-features = [ + "nix-command" + "flakes" + ]; build-users-group = "nixbld"; - trusted-users = [ "root" "larstvei" ]; + trusted-users = [ + "root" + "larstvei" + ]; substituters = [ "https://cache.nixos.org" @@ -24,9 +33,9 @@ }; }; - environment.systemPackages = - [ pkgs.git - pkgs.htop - pkgs.tree - ]; + environment.systemPackages = [ + pkgs.git + pkgs.htop + pkgs.tree + ]; } diff --git a/modules/home.nix b/modules/home.nix index 0c985c1..d6b4566 100644 --- a/modules/home.nix +++ b/modules/home.nix @@ -1,7 +1,15 @@ -{ lib, pkgs, emacs-larstvei, ... }: +{ + lib, + pkgs, + emacs-larstvei, + ... +}: let concatAttrVals = attrSet: lib.concatMap (x: x) (lib.attrValues attrSet); - tools = import ./tools.nix { inherit pkgs; inherit emacs-larstvei; }; + tools = import ./tools.nix { + inherit pkgs; + inherit emacs-larstvei; + }; langauges = import ./languages.nix { inherit pkgs; }; in { @@ -54,7 +62,11 @@ in enable = true; userName = "larstvei"; userEmail = "larstvei@ifi.uio.no"; - ignores = [ ".envrc" ".DS_Store" ".direnv" ]; + ignores = [ + ".envrc" + ".DS_Store" + ".direnv" + ]; }; direnv = { diff --git a/modules/languages.nix b/modules/languages.nix index 59c5089..7f001ff 100644 --- a/modules/languages.nix +++ b/modules/languages.nix @@ -1,5 +1,6 @@ { pkgs, ... }: -with pkgs; { +with pkgs; +{ bqn = [ cbqn ]; @@ -18,10 +19,11 @@ with pkgs; { ]; haskell = [ - (haskell.packages.ghc96.ghcWithPackages - (ps: with ps; [ + (haskell.packages.ghc96.ghcWithPackages ( + ps: with ps; [ QuickCheck - ])) + ] + )) stack ]; @@ -40,12 +42,12 @@ with pkgs; { nix = [ nil - nixfmt + nixfmt-rfc-style ]; python = [ - (python3.withPackages - (python-packages: with python-packages; [ + (python3.withPackages ( + python-packages: with python-packages; [ graphviz html2text hypothesis @@ -60,7 +62,8 @@ with pkgs; { xlsxwriter yattag z3 - ])) + ] + )) ]; tex = [ diff --git a/modules/macos.nix b/modules/macos.nix index e95af7a..13bf14b 100644 --- a/modules/macos.nix +++ b/modules/macos.nix @@ -1,4 +1,5 @@ -{ pkgs, lib, ... }: { +{ pkgs, lib, ... }: +{ fonts.packages = with pkgs; [ fira @@ -30,7 +31,9 @@ remapCapsLockToControl = true; }; defaults = { - screencapture = { location = "/tmp"; }; + screencapture = { + location = "/tmp"; + }; dock = { autohide = true; showhidden = true; @@ -62,7 +65,10 @@ upgrade = true; cleanup = "uninstall"; }; - taps = [ "homebrew/cask" "homebrew/cask-versions" ]; + taps = [ + "homebrew/cask" + "homebrew/cask-versions" + ]; casks = [ "amethyst" "arc" diff --git a/modules/tools.nix b/modules/tools.nix index f5cbc99..197e6a1 100644 --- a/modules/tools.nix +++ b/modules/tools.nix @@ -1,5 +1,6 @@ { pkgs, emacs-larstvei, ... }: -with pkgs; { +with pkgs; +{ editor = [ emacs-larstvei.defaultPackage.${pkgs.system}