Compare commits

...

20 Commits

Author SHA1 Message Date
733a944507 Remove system and extra-platforms
Not sure why it was there.
2024-10-06 22:46:21 +02:00
38f62cdff6 Separate out fonts
And also remove all but the fonts i use for everything.
2024-10-06 22:23:30 +02:00
2a7580fb3c hostname 2024-10-06 22:15:58 +02:00
81a4152a5f Clean up inputs 2024-10-06 22:15:47 +02:00
251e456fbc Move daemon enable 2024-10-06 22:10:53 +02:00
b10cc6728c Add rust 2024-10-06 22:04:01 +02:00
e780d835f3 Remove commented code 2024-10-06 21:57:00 +02:00
b6b5c8a1fc Formatting 2024-10-06 21:53:29 +02:00
f2ee1682c1 Divide into tools and languages 2024-10-06 21:47:51 +02:00
ec9964b750 Remove devenv
Never used it
2024-10-06 10:43:24 +02:00
7ed3b39467 Move a few packages to core 2024-10-06 10:42:00 +02:00
8385522f86 Update home manager
Now i can remove the direnv hook!
2024-10-06 01:46:21 +02:00
87849b99cd Start cleaning up 2024-10-06 01:42:54 +02:00
a97c687d62 Always ignore direnv 2024-10-05 20:29:34 +02:00
1ca409b0cb Remove nix-builder 2024-09-28 19:19:39 +02:00
bf5f88e1dc Update 2024-09-28 17:09:42 +02:00
1df1f650db Forgot to add nixbld (but unsure if necessary) 2024-09-28 17:09:24 +02:00
ee167c7622 Add utm for running VMs on macOS 2024-09-28 16:45:40 +02:00
f936f971b1 Add a linux builder
And a few other uncommitted changes
2024-09-28 16:45:19 +02:00
ca93c05844 Add a few mac apps 2024-08-31 12:09:08 +02:00
9 changed files with 259 additions and 180 deletions

View File

@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1721270582,
"narHash": "sha256-MdZmYPPExntE5rJu88IhJSy8Um4UyZCTXhOwvzbjDVI=",
"lastModified": 1727507295,
"narHash": "sha256-I/FrX1peu4URoj5T5odfuKR2rm4GjYJJpCGF9c0/lDA=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "a3e4a7b8ffc08c7dc1973822a77ad432e1ec3dec",
"rev": "f2e1c4aa29fc211947c3a7113cba1dd707433b70",
"type": "github"
},
"original": {
@ -23,11 +23,11 @@
"emacs-config": {
"flake": false,
"locked": {
"lastModified": 1721497986,
"narHash": "sha256-Z3Lx7334AiV/g0VYMZw0QLaZbnyLbEhKUvc0uAOTgNo=",
"lastModified": 1725551480,
"narHash": "sha256-NP2qZrT799JCny+8MKWSL6gdJGr1BxAoo9QOaNWo9UM=",
"owner": "larstvei",
"repo": "dot-emacs",
"rev": "8d5c90d13f16e09e13ecffde45523b27134b6c6b",
"rev": "32cbab47f8020cde616f16f0f0590612b637f2a3",
"type": "github"
},
"original": {
@ -45,11 +45,11 @@
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1721524893,
"narHash": "sha256-bI4wxmfDyA4Qb0EmqGNujsPxsKlrRxWl7X3xX1bRtZk=",
"lastModified": 1726969086,
"narHash": "sha256-CHKX91NOuVOiVQPzxNNZJLxi+bD/ACbTbbTGOplieGE=",
"owner": "larstvei",
"repo": "emacs-flake",
"rev": "a1bcb1220b072f38fb39a0843040c35c892d9751",
"rev": "678b51e6607341da055ad471de66c319536aada7",
"type": "github"
},
"original": {
@ -65,11 +65,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1721524329,
"narHash": "sha256-SyAHDx9l5cITXVfP48YFRZ9sfAh2dwIU4H3ed/T9Vrs=",
"lastModified": 1726967971,
"narHash": "sha256-UO0TQbj8UFI4tioDTjmui0UqTL8CZkwizolvxqJLGu0=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "717ae15d3131b195df37cc807ec3c4bff2342c06",
"rev": "2c5171a36fcd616753b204c34ef38bf7729825e2",
"type": "github"
},
"original": {
@ -81,11 +81,11 @@
"emacs-plus": {
"flake": false,
"locked": {
"lastModified": 1721032571,
"narHash": "sha256-jKTOwbm0cNp8D5pinF4wtn5beQRlLmsnClg+8ooDkX0=",
"lastModified": 1726592256,
"narHash": "sha256-Twamd/Doh2btEix3TK/NfilT5eZ6jEJ9rBXbJeVb6Yw=",
"owner": "d12frosted",
"repo": "homebrew-emacs-plus",
"rev": "323d86b2685a2420341e648bbc6c7b7c02029fa9",
"rev": "cc3280dfdf7562dd69c97d0dfa872b1c3313a18a",
"type": "github"
},
"original": {
@ -99,11 +99,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
@ -117,11 +117,11 @@
"systems": "systems_2"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
@ -137,11 +137,11 @@
]
},
"locked": {
"lastModified": 1721135958,
"narHash": "sha256-H548rpPMsn25LDKn1PCFmPxmWlClJJGnvdzImHkqjuY=",
"lastModified": 1727383923,
"narHash": "sha256-4/vacp3CwdGoPf8U4e/N8OsGYtO09WTcQK5FqYfJbKs=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "afd2021bedff2de92dfce0e257a3d03ae65c603d",
"rev": "ffe2d07e771580a005e675108212597e5b367d2d",
"type": "github"
},
"original": {
@ -152,11 +152,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1721379653,
"narHash": "sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0=",
"lastModified": 1726755586,
"narHash": "sha256-PmUr/2GQGvFTIJ6/Tvsins7Q43KTMvMFhvG6oaYK+Wk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1d9c2c9b3e71b9ee663d11c5d298727dace8d374",
"rev": "c04d5652cfa9742b1d519688f65d1bbccea9eb7e",
"type": "github"
},
"original": {
@ -168,11 +168,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1721409541,
"narHash": "sha256-b6PLr0Ty7JPDBtJtjnYzlBf02bbH9alWMAgispMkTwk=",
"lastModified": 1726838390,
"narHash": "sha256-NmcVhGElxDbmEWzgXsyAjlRhUus/nEqPC5So7BOJLUM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0c53b6b8c2a3e46c68e04417e247bba660689c9d",
"rev": "944b2aea7f0a2d7c79f72468106bc5510cbf5101",
"type": "github"
},
"original": {
@ -184,11 +184,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1721466660,
"narHash": "sha256-pFSxgSZqZ3h+5Du0KvEL1ccDZBwu4zvOil1zzrPNb3c=",
"lastModified": 1726871744,
"narHash": "sha256-V5LpfdHyQkUF7RfOaDPrZDP+oqz88lTJrMT1+stXNwo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6e14bbce7bea6c4efd7adfa88a40dac750d80100",
"rev": "a1d92660c6b3b7c26fb883500a80ea9d33321be2",
"type": "github"
},
"original": {
@ -200,11 +200,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1721466660,
"narHash": "sha256-pFSxgSZqZ3h+5Du0KvEL1ccDZBwu4zvOil1zzrPNb3c=",
"lastModified": 1727492312,
"narHash": "sha256-oRkgc+DosM3HIl9el98TxF2rtliKHCNVw00nlQC7xYM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6e14bbce7bea6c4efd7adfa88a40dac750d80100",
"rev": "4471f9f67fe0f95f5fec4cc2ebac59fe32af2b62",
"type": "github"
},
"original": {

View File

@ -1,5 +1,5 @@
{
description = "Lars' MacBook Pro";
description = "My nix configuration.";
inputs = {
nixpkgs = {
@ -16,12 +16,16 @@
emacs-larstvei.url = "github:larstvei/emacs-flake";
};
outputs = { self, nixpkgs, darwin, home-manager, emacs-larstvei, ... }@inputs: {
outputs =
{ darwin, home-manager, ... }@inputs:
{
darwinConfigurations."larstvei-macbookpro" = darwin.lib.darwinSystem {
system = "aarch64-darwin";
modules = [
./modules/mac.nix
./modules/core.nix
./modules/macos.nix
home-manager.darwinModule
{
home-manager = {
@ -35,9 +39,6 @@
};
};
}
({ config, pkgs, lib, ... }: {
services.nix-daemon.enable = true;
})
];
};
};

40
modules/core.nix Normal file
View File

@ -0,0 +1,40 @@
{ pkgs, ... }:
{
nix = {
package = pkgs.nix;
settings = {
experimental-features = [
"nix-command"
"flakes"
];
build-users-group = "nixbld";
trusted-users = [
"root"
"larstvei"
];
substituters = [
"https://cache.nixos.org"
"https://nix-community.cachix.org"
"https://larstvei.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"larstvei.cachix.org-1:mJq98qeTBnm2xNNibn2BEwN1ggi6uQg+5hWASdG1Vys="
];
};
};
environment.systemPackages = [
pkgs.git
pkgs.htop
pkgs.tree
];
services.nix-daemon.enable = true;
}

7
modules/fonts.nix Normal file
View File

@ -0,0 +1,7 @@
{ pkgs }:
with pkgs;
[
source-sans
source-code-pro
source-serif
]

View File

@ -1,93 +1,22 @@
{ pkgs, emacs-larstvei, ... }: {
home.packages = with pkgs; [
emacs-larstvei.defaultPackage.${pkgs.system}
(hunspellWithDicts [ hunspellDicts.nb_NO ])
(python3.withPackages
(python-packages: with python-packages; [
graphviz
html2text
hypothesis
matplotlib
numpy
openpyxl
pandas
pygments
python-lsp-server
scikit-learn
scipy
xlsxwriter
yattag
z3
]))
(haskell.packages.ghc96.ghcWithPackages
(ps: with ps; [
QuickCheck
]))
bat
babashka
# cargo
cbqn
clj-kondo
cloc
clojure
devenv
fd
ffmpeg
fzf
go
gopls
graphviz
htop
imagemagick
inkscape
jdk
jet
jq
leiningen
minizinc
nil
neil
nixfmt
pandoc
parallel
pdf2svg
poppler_utils
ripgrep
# rust-analyzer
rustup
stack
texlive.combined.scheme-full
tree
wget
];
{
lib,
pkgs,
emacs-larstvei,
...
}:
let
concatAttrVals = attrSet: lib.concatMap (x: x) (lib.attrValues attrSet);
tools = import ./tools.nix {
inherit pkgs;
inherit emacs-larstvei;
};
langauges = import ./languages.nix { inherit pkgs; };
in
{
home.packages = concatAttrVals langauges ++ concatAttrVals tools;
home.file.".config/enchant/hunspell/".source = "${pkgs.hunspellDicts.nb_NO}/share/hunspell/";
home.file.karabiner = {
target = ".config/karabiner/assets/complex_modifications/df_escape.json";
text = builtins.toJSON {
title = "Simultaneously press f + d to escape";
rules = [{
description = "Simultaneously press f + d to escape";
manipulators = [
{
type = "basic";
from = {
simultaneous = [
{ key_code = "f"; }
{ key_code = "d"; }
];
};
to = [
{ key_code = "escape"; }
];
}
];
}];
};
};
programs = {
fzf = {
enable = true;
@ -110,7 +39,6 @@
track_directories
end
set -gx DIRENV_LOG_FORMAT ""
direnv hook fish | source
'';
};
@ -134,7 +62,11 @@
enable = true;
userName = "larstvei";
userEmail = "larstvei@ifi.uio.no";
ignores = [ ".envrc" ".DS_Store" ];
ignores = [
".envrc"
".DS_Store"
".direnv"
];
};
direnv = {
@ -157,5 +89,5 @@
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "22.05";
home.stateVersion = "24.11";
}

78
modules/languages.nix Normal file
View File

@ -0,0 +1,78 @@
{ pkgs, ... }:
with pkgs;
{
bqn = [
cbqn
];
clojure = [
babashka
clj-kondo
clojure
leiningen
neil
];
go = [
go
gopls
];
haskell = [
(haskell.packages.ghc96.ghcWithPackages (
ps: with ps; [
QuickCheck
]
))
stack
];
java = [
jdk
jdt-language-server
];
maude = [
maude
];
minizinc = [
minizinc
];
nix = [
nil
nixfmt-rfc-style
];
python = [
(python3.withPackages (
python-packages: with python-packages; [
graphviz
html2text
hypothesis
matplotlib
numpy
openpyxl
pandas
pygments
python-lsp-server
scikit-learn
scipy
xlsxwriter
yattag
z3
]
))
];
rust = [
cargo
rustc
rust-analyzer
];
tex = [
texlive.combined.scheme-full
];
}

View File

@ -1,36 +1,18 @@
{ pkgs, lib, ... }: {
{ pkgs, lib, ... }:
{
nix = {
package = pkgs.nix;
extraOptions = ''
system = aarch64-darwin # M1 gang
extra-platforms = aarch64-darwin x86_64-darwin # But we use rosetta too
experimental-features = nix-command flakes
build-users-group = nixbld
trusted-users = root larstvei
'';
};
fonts.packages = with pkgs; [
fira
fira-code
iosevka
roboto
roboto-mono
source-sans
source-code-pro
source-serif
];
fonts.packages = import ./fonts.nix { inherit pkgs; };
users.users."larstvei".home = "/Users/larstvei";
programs.fish.enable = true;
system.activationScripts.postActivation.text = ''
# Set the default shell as fish for the user. MacOS doesn't do this like nixOS does
sudo chsh -s ${lib.getBin pkgs.fish}/bin/fish larstvei
'';
networking.hostName = "macbookpro";
networking.hostName = "larstvei-macbookpro";
system = {
stateVersion = 4;
@ -40,7 +22,9 @@
remapCapsLockToControl = true;
};
defaults = {
screencapture = { location = "/tmp"; };
screencapture = {
location = "/tmp";
};
dock = {
autohide = true;
showhidden = true;
@ -72,25 +56,28 @@
upgrade = true;
cleanup = "uninstall";
};
taps = [ "homebrew/cask" "homebrew/cask-versions" ];
taps = [
"homebrew/cask"
"homebrew/cask-versions"
];
casks = [
"amethyst"
"arc"
"chatgpt"
"docker"
"dropbox"
# "expressvpn"
# "firefox-developer-edition"
"google-chrome"
"iina"
"karabiner-elements"
# "mactex"
"obs"
"ollama"
"processing"
"raycast"
"remarkable"
"signal"
"skim"
"supercollider"
"utm"
"zoom"
];
};

37
modules/tools.nix Normal file
View File

@ -0,0 +1,37 @@
{ pkgs, emacs-larstvei, ... }:
with pkgs;
{
editor = [
emacs-larstvei.defaultPackage.${pkgs.system}
];
spelling = [
(hunspellWithDicts [ hunspellDicts.nb_NO ])
];
modernReplacements = [
bat
fd
ripgrep
];
utils = [
cloc
jet
jq
pandoc
parallel
wget
];
multimedia = [
ffmpeg
graphviz
imagemagick
inkscape
pdf2svg
poppler_utils
];
}

View File

@ -1,3 +0,0 @@
experimental-features = nix-command flakes
substituters = https://cache.nixos.org https://cache.nixos.org/ https://nix-community.cachix.org https://larstvei.cachix.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= larstvei.cachix.org-1:mJq98qeTBnm2xNNibn2BEwN1ggi6uQg+5hWASdG1Vys=