yep, more dotfiles

feat: initialize nixos dotfiles

Milo Moisson 0b496bac

+263
flake.lock
···
···
+
{
+
"nodes": {
+
"agenix": {
+
"inputs": {
+
"darwin": "darwin",
+
"home-manager": "home-manager",
+
"nixpkgs": [
+
"nixpkgs"
+
]
+
},
+
"locked": {
+
"lastModified": 1696775529,
+
"narHash": "sha256-TYlE4B0ktPtlJJF9IFxTWrEeq+XKG8Ny0gc2FGEAdj0=",
+
"owner": "ryantm",
+
"repo": "agenix",
+
"rev": "daf42cb35b2dc614d1551e37f96406e4c4a2d3e4",
+
"type": "github"
+
},
+
"original": {
+
"owner": "ryantm",
+
"repo": "agenix",
+
"type": "github"
+
}
+
},
+
"base16-schemes": {
+
"flake": false,
+
"locked": {
+
"lastModified": 1689473676,
+
"narHash": "sha256-L0RhUr9+W5EPWBpLcmkKpUeCEWRs/kLzVMF3Vao2ZU0=",
+
"owner": "tinted-theming",
+
"repo": "base16-schemes",
+
"rev": "d95123ca6377cd849cfdce92c0a24406b0c6a789",
+
"type": "github"
+
},
+
"original": {
+
"owner": "tinted-theming",
+
"repo": "base16-schemes",
+
"type": "github"
+
}
+
},
+
"darwin": {
+
"inputs": {
+
"nixpkgs": [
+
"agenix",
+
"nixpkgs"
+
]
+
},
+
"locked": {
+
"lastModified": 1698429334,
+
"narHash": "sha256-Gq3+QabboczSu7RMpcy79RSLMSqnySO3wsnHQk4DfbE=",
+
"owner": "lnl7",
+
"repo": "nix-darwin",
+
"rev": "afe83cbc2e673b1f08d32dd0f70df599678ff1e7",
+
"type": "github"
+
},
+
"original": {
+
"owner": "lnl7",
+
"ref": "master",
+
"repo": "nix-darwin",
+
"type": "github"
+
}
+
},
+
"disko": {
+
"inputs": {
+
"nixpkgs": [
+
"nixpkgs"
+
]
+
},
+
"locked": {
+
"lastModified": 1698422527,
+
"narHash": "sha256-SDu3Xg263t3oXIyTaH0buOvFnKIDeZsvKDBtOz+jRbs=",
+
"owner": "nix-community",
+
"repo": "disko",
+
"rev": "944d338d24a9d043a3f7461c30ee6cfe4f9cca30",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nix-community",
+
"repo": "disko",
+
"type": "github"
+
}
+
},
+
"hardware": {
+
"locked": {
+
"lastModified": 1698053470,
+
"narHash": "sha256-sP8D/41UiwC2qn0X40oi+DfuVzNHMROqIWdSdCI/AYA=",
+
"owner": "nixos",
+
"repo": "nixos-hardware",
+
"rev": "80d98a7d55c6e27954a166cb583a41325e9512d7",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nixos",
+
"repo": "nixos-hardware",
+
"type": "github"
+
}
+
},
+
"home-manager": {
+
"inputs": {
+
"nixpkgs": [
+
"agenix",
+
"nixpkgs"
+
]
+
},
+
"locked": {
+
"lastModified": 1682203081,
+
"narHash": "sha256-kRL4ejWDhi0zph/FpebFYhzqlOBrk0Pl3dzGEKSAlEw=",
+
"owner": "nix-community",
+
"repo": "home-manager",
+
"rev": "32d3e39c491e2f91152c84f8ad8b003420eab0a1",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nix-community",
+
"repo": "home-manager",
+
"type": "github"
+
}
+
},
+
"home-manager-unstable": {
+
"inputs": {
+
"nixpkgs": [
+
"nixpkgs"
+
]
+
},
+
"locked": {
+
"lastModified": 1699783872,
+
"narHash": "sha256-4zTwLT2LL45Nmo6iwKB3ls3hWodVP9DiSWxki/oewWE=",
+
"owner": "nix-community",
+
"repo": "home-manager",
+
"rev": "280721186ab75a76537713ec310306f0eba3e407",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nix-community",
+
"ref": "master",
+
"repo": "home-manager",
+
"type": "github"
+
}
+
},
+
"home-manager_2": {
+
"inputs": {
+
"nixpkgs": [
+
"nixpkgs"
+
]
+
},
+
"locked": {
+
"lastModified": 1695108154,
+
"narHash": "sha256-gSg7UTVtls2yO9lKtP0yb66XBHT1Fx5qZSZbGMpSn2c=",
+
"owner": "nix-community",
+
"repo": "home-manager",
+
"rev": "07682fff75d41f18327a871088d20af2710d4744",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nix-community",
+
"ref": "release-23.05",
+
"repo": "home-manager",
+
"type": "github"
+
}
+
},
+
"nix-colors": {
+
"inputs": {
+
"base16-schemes": "base16-schemes",
+
"nixpkgs-lib": "nixpkgs-lib"
+
},
+
"locked": {
+
"lastModified": 1695388192,
+
"narHash": "sha256-2jelpE7xK+4M7jZNyWL7QYOYegQLYBDQS5bvdo8XRUQ=",
+
"owner": "misterio77",
+
"repo": "nix-colors",
+
"rev": "37227f274b34a3b51649166deb94ce7fec2c6a4c",
+
"type": "github"
+
},
+
"original": {
+
"owner": "misterio77",
+
"repo": "nix-colors",
+
"type": "github"
+
}
+
},
+
"nix-index-database": {
+
"inputs": {
+
"nixpkgs": [
+
"nixpkgs"
+
]
+
},
+
"locked": {
+
"lastModified": 1698550809,
+
"narHash": "sha256-Um8+Wi6EAH5dCgfgl7OqaVd4wFJn6FKLafcP5QPr/98=",
+
"owner": "Mic92",
+
"repo": "nix-index-database",
+
"rev": "1f0981f5baeb78e3c89a8980ff1a39f06876fa8c",
+
"type": "github"
+
},
+
"original": {
+
"owner": "Mic92",
+
"repo": "nix-index-database",
+
"type": "github"
+
}
+
},
+
"nixpkgs": {
+
"locked": {
+
"lastModified": 1698434055,
+
"narHash": "sha256-Phxi5mUKSoL7A0IYUiYtkI9e8NcGaaV5PJEaJApU1Ko=",
+
"owner": "nixos",
+
"repo": "nixpkgs",
+
"rev": "1a3c95e3b23b3cdb26750621c08cc2f1560cb883",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nixos",
+
"ref": "nixos-23.05",
+
"repo": "nixpkgs",
+
"type": "github"
+
}
+
},
+
"nixpkgs-lib": {
+
"locked": {
+
"lastModified": 1694911725,
+
"narHash": "sha256-8YqI+YU1DGclEjHsnrrGfqsQg3Wyga1DfTbJrN3Ud0c=",
+
"owner": "nix-community",
+
"repo": "nixpkgs.lib",
+
"rev": "819180647f428a3826bfc917a54449da1e532ce0",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nix-community",
+
"repo": "nixpkgs.lib",
+
"type": "github"
+
}
+
},
+
"nixpkgs-unstable": {
+
"locked": {
+
"lastModified": 1698318101,
+
"narHash": "sha256-gUihHt3yPD7bVqg+k/UVHgngyaJ3DMEBchbymBMvK1E=",
+
"owner": "nixos",
+
"repo": "nixpkgs",
+
"rev": "63678e9f3d3afecfeafa0acead6239cdb447574c",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nixos",
+
"ref": "nixos-unstable",
+
"repo": "nixpkgs",
+
"type": "github"
+
}
+
},
+
"root": {
+
"inputs": {
+
"agenix": "agenix",
+
"disko": "disko",
+
"hardware": "hardware",
+
"home-manager": "home-manager_2",
+
"home-manager-unstable": "home-manager-unstable",
+
"nix-colors": "nix-colors",
+
"nix-index-database": "nix-index-database",
+
"nixpkgs": "nixpkgs",
+
"nixpkgs-unstable": "nixpkgs-unstable"
+
}
+
}
+
},
+
"root": "root",
+
"version": 7
+
}
+102
flake.nix
···
···
+
{
+
description = "NixOS and Home Manager configuration for Milo's laptops";
+
+
inputs = {
+
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
+
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
+
# Also see the 'unstable-packages' overlay at 'overlays/default.nix'.
+
+
home-manager = {
+
url = "github:nix-community/home-manager/release-23.05";
+
inputs.nixpkgs.follows = "nixpkgs";
+
};
+
+
home-manager-unstable = {
+
url = "github:nix-community/home-manager/master";
+
inputs.nixpkgs.follows = "nixpkgs";
+
};
+
+
agenix = {
+
url = "github:ryantm/agenix";
+
inputs.nixpkgs.follows = "nixpkgs";
+
};
+
+
nix-index-database = {
+
url = "github:Mic92/nix-index-database";
+
inputs.nixpkgs.follows = "nixpkgs";
+
};
+
+
disko = {
+
url = "github:nix-community/disko";
+
inputs.nixpkgs.follows = "nixpkgs";
+
};
+
+
nix-colors.url = "github:misterio77/nix-colors";
+
+
hardware.url = "github:nixos/nixos-hardware";
+
};
+
+
outputs = { self, nixpkgs, home-manager, agenix, nix-index-database, disko, nix-colors, ... }@inputs:
+
let
+
inherit (self) outputs;
+
systems = [ "aarch64-linux" "i686-linux" "x86_64-linux" "aarch64-darwin" "x86_64-darwin" ];
+
forAllSystems = nixpkgs.lib.genAttrs systems;
+
+
baseModules = [
+
./nixos/configuration.nix
+
disko.nixosModules.disko
+
];
+
in
+
{
+
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
+
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixpkgs-fmt);
+
+
overlays = import ./overlays { inherit inputs; };
+
nixosModules = import ./modules/nixos;
+
homeManagerModules = import ./modules/home-manager;
+
+
nixosConfigurations = {
+
"neo-wiro-laptop" = nixpkgs.lib.nixosSystem {
+
specialArgs = { inherit inputs outputs; };
+
modules = baseModules ++ [
+
# TODO: copy when generated
+
# ./nixos/hardware/neo.nix
+
];
+
};
+
+
"archaic-wiro-laptop" = nixpkgs.lib.nixosSystem {
+
specialArgs = { inherit inputs outputs; };
+
modules = baseModules ++ [
+
./nixos/hardware/archaic.nix
+
];
+
};
+
};
+
+
homeConfigurations = {
+
"milomoisson" = home-manager.lib.homeManagerConfiguration {
+
# Home-manager requires 'pkgs' instance
+
pkgs = nixpkgs.legacyPackages.x86_64-linux;
+
extraSpecialArgs = { inherit inputs outputs; };
+
modules = [
+
./home-manager
+
+
# Agenix secrets manager
+
agenix.homeManagerModules.default
+
# TODO: dont hardcode system
+
{ home.packages = [ agenix.packages.x86_64-linux.default ]; }
+
+
# Setup `comma`, which allow to easily run command that are not present on the system
+
nix-index-database.hmModules.nix-index
+
+
# Nix colors
+
nix-colors.homeManagerModules.default
+
{ colorScheme = nix-colors.colorSchemes.onedark; }
+
./secrets
+
+
# Unstable module taken from master branch
+
# outputs.homeManagerModules.darkman
+
];
+
};
+
};
+
};
+
}
home-manager/assets/BinaryCloud.png

This is a binary file and will not be displayed.

+28
home-manager/assets/workstyle.toml
···
···
+
# NOTE: if multiple patterns are present in the same application name,
+
# precedence is given in order of apparition in this file.
+
+
"github" = ""
+
"rust" = ""
+
"google" = ""
+
"firefox" = ""
+
+
"kitty" = ""
+
"file manager" = ""
+
"libreoffice calc" = ""
+
+
"nvim" = ""
+
"transmission" = ""
+
"music" = ""
+
"visual studio code" = "󰘐"
+
+
# TODO fix
+
"libreoffice writer" = ""
+
"libreoffice" = ""
+
"calculator" = ""
+
"videostream" = ""
+
"mpv" = ""
+
"disk usage" = ""
+
".pdf" = ""
+
+
[other]
+
"fallback_icon" = ""
+144
home-manager/default.nix
···
···
+
{ inputs
+
, outputs
+
, lib
+
, config
+
, pkgs
+
, ...
+
}: {
+
imports = [
+
(inputs.home-manager-unstable + /modules/services/darkman.nix)
+
+
./vm.nix
+
./git.nix
+
./shell.nix
+
];
+
+
nixpkgs = {
+
overlays = with outputs.overlays; [
+
additions
+
modifications
+
unstable-packages
+
];
+
config = {
+
# Disable if you don't want unfree packages
+
allowUnfree = true;
+
# Workaround for https://github.com/nix-community/home-manager/issues/2942
+
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
+
"authy"
+
"discord"
+
"spotify"
+
"vscode"
+
"thorium-browser"
+
"unrar"
+
];
+
};
+
};
+
+
programs.home-manager.enable = true;
+
+
home = {
+
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
+
stateVersion = "23.05";
+
username = "milomoisson";
+
homeDirectory = "/home/milomoisson";
+
+
sessionVariables = {
+
EDITOR = "${pkgs.helix}/bin/hx";
+
};
+
+
packages = with pkgs; [
+
# Unfree packages
+
authy
+
discord
+
spotify
+
thorium
+
+
spotify-tui
+
+
cinnamon.nemo
+
firefox
+
# Firefox needs speedd for voice synthesis web api
+
speechd
+
transmission
+
+
xdg-utils
+
rustup
+
+
# For VSCode nix ext, find workaround for this not to be in path
+
rnix-lsp
+
+
# Cli tools
+
bat
+
fd
+
delta
+
ripgrep
+
+
imv
+
mpv
+
wl-clipboard
+
wf-recorder
+
];
+
};
+
+
xdg.mimeApps = {
+
enable = true;
+
associations.added = {
+
"application/pdf" = [ "firefox.desktop" ];
+
};
+
defaultApplications = {
+
"application/pdf" = [ "firefox.desktop" ];
+
};
+
};
+
+
# Nicely reload system units when changing configs
+
systemd.user.startServices = "sd-switch";
+
+
programs.qutebrowser.enable = true;
+
+
programs.kitty = {
+
enable = true;
+
settings = {
+
confirm_os_window_close = 0;
+
+
# foreground = "#${config.colorScheme.colors.base05}";
+
# background = "#${config.colorScheme.colors.base00}";
+
};
+
};
+
+
programs.vscode = {
+
enable = true;
+
# package = pkgs.unstable.vscode;
+
};
+
+
# TODO: configure
+
services.spotifyd.enable = true;
+
+
programs.gpg = {
+
enable = true;
+
+
};
+
+
+
programs.topgrade = {
+
enable = true;
+
package = pkgs.unstable.topgrade;
+
settings = {
+
misc = {
+
# Don't ask for confirmations
+
assume_yes = true;
+
+
# Run `sudo -v` to cache credentials at the start of the run; this avoids a
+
# blocking password prompt in the middle of a possibly-unattended run.
+
pre_sudo = true;
+
+
skip_notify = true;
+
disable = [ "rustup" ];
+
no_retry = true;
+
cleanup = true;
+
};
+
+
# TODO: sepcify via global config
+
git.repos = [ "~/Documents/Developement/*/*" "~/.config/dotfiles" ];
+
};
+
};
+
}
+90
home-manager/git.nix
···
···
+
{ config, lib, pkgs, ... }:
+
with lib;
+
{
+
config = {
+
programs.git = {
+
enable = true;
+
lfs.enable = true;
+
+
userName = "Milo Moisson";
+
# TODO: this email should be behind a secret
+
userEmail = "milomoisson@gmail.com";
+
+
signing = {
+
signByDefault = true;
+
key = "3C01CA5E";
+
};
+
+
difftastic.enable = true;
+
+
aliases = {
+
b = "branch --all";
+
brm = "branch --delete";
+
+
ll = "log --graph --oneline";
+
lla = "log --graph --oneline --all";
+
last = "log -1 HEAD --stat";
+
+
st = "status --short --branch";
+
+
cm = "commit --message";
+
oups = "commit --amend";
+
+
ui = "!${pkgs.gitui}/bin/gitui";
+
+
rv = "remote --verbose";
+
+
a = "add";
+
al = "add --all";
+
ac = "add .";
+
ap = "add --patch";
+
+
pu = "push";
+
pl = "pull";
+
+
f = "fetch";
+
+
s = "switch";
+
sc = "switch --create";
+
+
ck = "checkout";
+
+
df = "diff";
+
dfs = "diff --staged";
+
dfc = "diff --cached";
+
+
m = "merge";
+
+
rms = "restore --staged";
+
res = "restore";
+
+
sh = "stash";
+
shl = "stash list";
+
sha = "stash apply";
+
shp = "stash pop";
+
};
+
+
extraConfig = {
+
fetch.prune = true;
+
color.ui = true;
+
init.defaultBranch = "main";
+
+
# TODO: connect to a SSOT
+
github.user = "mrnossiom";
+
+
credential.helper = "${pkgs.git.override { withLibsecret = true; }}/bin/git-credential-libsecret";
+
"credentials \"https://github.com\"".helper = "!${pkgs.gh}/bin/gh auth git-credential";
+
+
leaveTool.defaultFolder = "~/Documents";
+
};
+
};
+
+
programs.gh = {
+
enable = true;
+
# extensions = with pkgs; [ gh-dash ];
+
};
+
+
# TODO: unstable hm
+
# programs.gh-dash.enable = true;
+
};
+
}
+121
home-manager/shell.nix
···
···
+
{ config, lib, pkgs, ... }:
+
with lib;
+
{
+
config = {
+
programs.nix-index.enableFishIntegration = false;
+
programs.nix-index-database.comma.enable = true;
+
+
programs.starship.enable = true;
+
+
programs.helix = {
+
enable = true;
+
package = pkgs.unstable.helix;
+
settings = {
+
theme = "onedark";
+
editor = {
+
line-number = "relative";
+
mouse = false;
+
indent-guides = {
+
render = true;
+
characters = "╎";
+
};
+
};
+
keys = rec {
+
insert = {
+
up = "no_op";
+
down = "no_op";
+
left = "no_op";
+
right = "no_op";
+
};
+
# Work the same in normal mode
+
normal = insert;
+
};
+
};
+
languages = {
+
# Language server for nix
+
language-server.rnix-lsp.command = "${pkgs.rnix-lsp}/bin/rnix-lsp";
+
+
language = [{
+
name = "nix";
+
language-servers = [ "rnix-lsp" ];
+
}];
+
};
+
};
+
+
programs.fish = {
+
enable = true;
+
+
# TODO: verify security and check swayidle
+
loginShellInit = ''
+
if test (id --user $USER) -ge 1000 && test (tty) = "/dev/tty1"
+
exec sway
+
end
+
'';
+
+
interactiveShellInit = ''
+
# Use exa instead of ls
+
set -U __fish_ls_command ${pkgs.exa}/bin/exa
+
set -U __fish_ls_color_opt '--color=auto'
+
+
abbr -a !! --position anywhere --function last_history_item
+
'';
+
+
shellAbbrs = {
+
# One letter abbrs
+
b = "bun";
+
c = "cargo";
+
d = "docker";
+
g = "git";
+
j = "just";
+
+
# Docker
+
dcu = "docker compose up -d";
+
dcd = "docker compose down";
+
+
# Edit utilities
+
rm = "rm -i";
+
rmd = "rm -rd";
+
cp = "cp -iv";
+
ln = "ln -v";
+
mv = "mv -iv";
+
mkdir = "mkdir -v";
+
+
# Listing utilities
+
l = "ls -GlhFa";
+
ll = "ls -lhFa";
+
ls = "ls -Fa";
+
ld = "ls -FD";
+
tree = "ls -T";
+
+
# Renamed tools
+
grep = "rg";
+
cat = "bat";
+
diff = "delta";
+
+
# Nix-related
+
ns = "nix-shell -p";
+
+
# Do not keep these commands in history
+
shutdown = " shutdown";
+
clr = " clear";
+
reboot = " reboot";
+
history = " history";
+
exit = " exit";
+
};
+
+
functions = {
+
# Fish specific
+
fish_greeting = ''
+
echo 'Hello '(set_color brblue)(whoami)(set_color normal)' you are on '(set_color brred)(uname)(set_color normal)'.'
+
echo 'Current directory is '(set_color brgreen)(pwd)(set_color normal)
+
'';
+
last_history_item = "echo $history[1]";
+
+
# Quickly cd into a derivation
+
# NOTE: another channel can be specified after the derivation, tail uses the last derivation
+
# e.g. `cdd fontforge` or `cdd fontforge '<nixpkgs-unstable>'`
+
cdd = "cd (nix-build --no-out-link '<nixpkgs>' -A $argv | tail -n1)";
+
};
+
};
+
};
+
}
+412
home-manager/vm.nix
···
···
+
{ config
+
, lib
+
, pkgs
+
, ...
+
}:
+
with lib;
+
with builtins;
+
+
let
+
workspaces-range = zipListsWith (num: ws: { inherit ws num; }) [ 1 2 3 4 5 6 7 8 9 0 ] (range 1 10);
+
swaylock-args = [ ];
+
in
+
{
+
config = {
+
services.mako = with config.colorScheme.colors; {
+
enable = true;
+
+
font = "sans-serif 10";
+
backgroundColor = "#${base0D}";
+
textColor = "#ffffff";
+
+
icons = true;
+
# TODO: iconPath = "";
+
+
width = 500;
+
maxVisible = 5;
+
sort = "-priority";
+
+
borderSize = 0;
+
borderRadius = 5;
+
+
extraConfig = ''
+
[urgency="low"]
+
background-color=#${base0A}
+
[urgency="critical"]
+
background-color=#${base0F}
+
'';
+
};
+
+
gtk = {
+
enable = true;
+
theme = {
+
name = "Arc-Dark";
+
package = pkgs.arc-theme;
+
};
+
cursorTheme = {
+
name = "Bibata-Modern-Ice";
+
package = pkgs.bibata-cursors;
+
};
+
iconTheme = {
+
name = "Papirus";
+
package = pkgs.papirus-icon-theme;
+
};
+
};
+
+
services.swayidle = {
+
enable = true;
+
timeouts = [
+
# TODO: this doesn't work find a way to quickly cut output when locked and idle
+
{
+
timeout = 1;
+
command = "if pgrep -x swaylock; then ${pkgs.sway}/bin/swaymsg \"output * power off\"; fi";
+
resumeCommand = "${pkgs.sway}/bin/swaymsg \"output * power on\"";
+
}
+
+
{ timeout = 60 * 1; command = "${pkgs.sway}/bin/swaymsg \"output * power off\""; resumeCommand = "${pkgs.sway}/bin/swaymsg \"output * power on\""; }
+
{ timeout = 60 * 5; command = "${pkgs.systemd}/bin/loginctl lock-session"; }
+
{ timeout = 60 * 15; command = "${pkgs.systemd}/bin/systemctl suspend"; }
+
];
+
events = [
+
{ event = "before-sleep"; command = "${pkgs.playerctl}/bin/playerctl pause"; }
+
# Can be triggered with `loginctl lock-session`
+
{ event = "lock"; command = "${pkgs.swaylock}/bin/swaylock -feF --indicator-y-position 980 --indicator-x-position 100 -i ${./assets/BinaryCloud.png}"; }
+
];
+
};
+
+
wayland.windowManager.sway = {
+
enable = true;
+
config = rec {
+
modifier = "Mod4";
+
terminal = "${pkgs.kitty}/bin/kitty";
+
menu = "${pkgs.tofi}/bin/tofi-drun --font ${pkgs.inter}/share/fonts/opentype/Inter-Regular.otf | xargs swaymsg exec --";
+
+
defaultWorkspace = "workspace number 1";
+
+
left = "h";
+
down = "j";
+
up = "k";
+
right = "l";
+
+
window = {
+
titlebar = false;
+
commands = [
+
{
+
# Tag of shame
+
command = ''title_format "%title <small>[XWayland]</small>"'';
+
criteria = {
+
shell = "xwayland";
+
};
+
}
+
];
+
};
+
+
startup = [
+
{
+
command = "${pkgs.workstyle}/bin/workstyle &> /tmp/workstyle.log";
+
always = true;
+
}
+
];
+
+
focus.followMouse = false;
+
+
gaps.smartBorders = "no_gaps";
+
+
colors = with config.colorScheme.colors; {
+
background = "#${base00}";
+
+
focused = {
+
background = "#285577";
+
border = "#4c7899";
+
childBorder = "#285577";
+
indicator = "#2e9ef4";
+
text = "#ffffff";
+
};
+
+
focusedInactive = {
+
background = "#5f676a";
+
border = "#333333";
+
childBorder = "#5f676a";
+
indicator = "#484e50";
+
text = "#ffffff";
+
};
+
+
placeholder = {
+
background = "#0c0c0c";
+
border = "#000000";
+
childBorder = "#0c0c0c";
+
indicator = "#000000";
+
text = "#ffffff";
+
};
+
+
unfocused = {
+
background = "#222222";
+
border = "#333333";
+
childBorder = "#222222";
+
indicator = "#292d2e";
+
text = "#888888";
+
};
+
+
urgent = {
+
background = "#900000";
+
border = "#2f343a";
+
childBorder = "#900000";
+
indicator = "#900000";
+
text = "#ffffff";
+
};
+
};
+
+
bars = [
+
{
+
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${config.home.homeDirectory}/${config.xdg.configFile."i3status-rust/config-default.toml".target}";
+
hiddenState = "hide";
+
mode = "hide";
+
+
colors = with config.colorScheme.colors; {
+
background = "#${base00}";
+
focusedBackground = "#${base00}";
+
separator = "#cccccc";
+
focusedSeparator = "#cccccc";
+
statusline = "#cccccc";
+
focusedStatusline = "#cccccc";
+
+
focusedWorkspace = rec {
+
text = "#${base07}";
+
background = "#${base0C}";
+
border = background;
+
};
+
+
inactiveWorkspace = rec {
+
text = "#${base05}";
+
background = "#${base01}";
+
border = background;
+
};
+
+
activeWorkspace = rec {
+
text = "#${base08}";
+
background = "#${base0C}";
+
border = background;
+
};
+
+
urgentWorkspace = rec {
+
text = "#ffffff";
+
background = "#${base0F}";
+
border = background;
+
};
+
+
bindingMode = rec {
+
text = "#ffffff";
+
background = "#${base0F}";
+
border = background;
+
};
+
};
+
+
# Would be nice to have rounded corners and padding when appearing
+
+
# Doesn't add icons
+
extraConfig = ''
+
icon_theme Papirus
+
'';
+
}
+
];
+
+
input = {
+
"type:keyboard" = {
+
xkb_layout = "us,fr";
+
xkb_options = "grp:menu_toggle,compose:caps";
+
+
repeat_delay = toString 250;
+
repeat_rate = toString 45;
+
};
+
};
+
+
seat = {
+
"seat0" = {
+
xcursor_theme = "Bibata-Modern-Ice";
+
hide_cursor = "when-typing enable";
+
# Workaround, because key cannot be included twice
+
# Clears cursor after 5s
+
"" = "hide_cursor 5000";
+
};
+
};
+
+
bindkeysToCode = true;
+
keybindings = {
+
"${modifier}+Return" = "exec ${terminal}";
+
"${modifier}+Shift+Return" = "exec ${pkgs.cinnamon.nemo}/bin/nemo";
+
"${modifier}+Shift+q" = "kill";
+
"${modifier}+d" = "exec ${menu}";
+
# Same but run instead of drun mode
+
"${modifier}+Shift+d" = "exec ${pkgs.tofi}/bin/tofi-run --font ${pkgs.inter}/share/fonts/opentype/Inter-Regular.otf | xargs swaymsg exec --";
+
"${modifier}+Space" = "exec ${pkgs.mako}/bin/makoctl dismiss";
+
+
"${modifier}+Escape" = "exec loginctl lock-session";
+
+
"${modifier}+${left}" = "focus left";
+
"${modifier}+${down}" = "focus down";
+
"${modifier}+${up}" = "focus up";
+
"${modifier}+${right}" = "focus right";
+
+
"${modifier}+Shift+${left}" = "move left";
+
"${modifier}+Shift+${down}" = "move down";
+
"${modifier}+Shift+${up}" = "move up";
+
"${modifier}+Shift+${right}" = "move right";
+
+
"${modifier}+r" = "mode resize";
+
"${modifier}+f" = "fullscreen toggle";
+
"${modifier}+Shift+space" = "floating toggle";
+
+
# Screenshotting
+
"${modifier}+s" = ''exec ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" - | ${pkgs.wl-clipboard}/bin/wl-copy'';
+
# TODO: replace swatty by satty
+
"${modifier}+Shift+s" = "exec ${pkgs.wl-clipboard}/bin/wl-paste | ${pkgs.swappy}/bin/swappy --file - --output-file - | ${pkgs.wl-clipboard}/bin/wl-copy";
+
+
+
# Soundcontrol Keys
+
XF86AudioPrev = "exec ${pkgs.playerctl}/bin/playerctl previous";
+
XF86AudioNext = "exec ${pkgs.playerctl}/bin/playerctl next";
+
XF86AudioPlay = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
+
XF86AudioStop = "exec ${pkgs.playerctl}/bin/playerctl stop";
+
+
# Avizo controled
+
XF86AudioRaiseVolume = "exec ${pkgs.avizo}/bin/volumectl -u up";
+
XF86AudioLowerVolume = "exec ${pkgs.avizo}/bin/volumectl -u down";
+
XF86AudioMute = "exec ${pkgs.avizo}/bin/volumectl toggle-mute";
+
XF86AudioMicMute = "exec ${pkgs.avizo}/bin/volumectl -m toggle-mute";
+
XF86MonBrightnessUp = "exec ${pkgs.avizo}/bin/lightctl up";
+
XF86MonBrightnessDown = "exec ${pkgs.avizo}/bin/lightctl down";
+
}
+
// listToAttrs (map (num: { name = "${modifier}+${toString num.num}"; value = "workspace number ${toString num.ws}"; }) workspaces-range)
+
// listToAttrs (map (num: { name = "${modifier}+Alt+${toString num.num}"; value = "move container to workspace number ${toString num.ws}"; }) workspaces-range)
+
// listToAttrs (map (num: { name = "${modifier}+Alt+Shift+${toString num.num}"; value = "move container to workspace number ${toString num.ws}; workspace number ${toString num.ws}"; }) workspaces-range);
+
+
modes = {
+
resize = {
+
"${left}" = "resize shrink width 10 px";
+
"${down}" = "resize grow height 10 px";
+
"${up}" = "resize shrink height 10 px";
+
"${right}" = "resize grow width 10 px";
+
+
"${modifier}" = "mode default";
+
"${modifier}+r" = "mode default";
+
"Return" = "mode default";
+
"Escape" = "mode default";
+
};
+
};
+
};
+
};
+
+
programs.i3status-rust = {
+
enable = true;
+
bars.default = rec {
+
theme = "modern";
+
icons = "awesome6";
+
blocks = [
+
{ block = "focused_window"; }
+
{
+
block = "disk_space";
+
path = "/";
+
info_type = "available";
+
interval = 60;
+
warning = 20.0;
+
alert = 10.0;
+
}
+
{ block = "memory"; }
+
{
+
block = "cpu";
+
interval = 5;
+
}
+
{
+
block = "pomodoro";
+
notify_cmd = "notify-send -w '{msg}'";
+
blocking_cmd = true;
+
}
+
{ block = "music"; }
+
{
+
format = " 󰌌 $layout ";
+
block = "keyboard_layout";
+
driver = "sway";
+
}
+
{ block = "sound"; }
+
{ block = "battery"; }
+
{
+
block = "time";
+
interval = 60;
+
format = " $timestamp.datetime(f:'%a %d/%m %R') ";
+
}
+
];
+
+
# settings.theme = {
+
# inherit theme;
+
# overrides = { };
+
# };
+
};
+
};
+
+
services.blueman-applet.enable = true;
+
+
services.wlsunset = {
+
enable = true;
+
latitude = toString 48.8;
+
longitude = toString 2.3;
+
};
+
+
services.darkman = {
+
enable = true;
+
settings = {
+
lat = 48.8;
+
lng = 2.3;
+
usegeoclue = true;
+
};
+
};
+
+
services.avizo.enable = true;
+
+
# We could've used `(pkgs.formats.toml { }).generate "config.toml" { <opts> }`
+
# but this doesn't keep ordering, and ordering is important here
+
xdg.configFile."workstyle/config.toml".source = ./assets/workstyle.toml;
+
+
# Could be included to access nix-colors
+
xdg.configFile."tofi/config".text = with config.colorScheme.colors; lib.generators.toKeyValue { } {
+
font-size = 14;
+
+
horizontal = true;
+
anchor = "top";
+
width = "100%";
+
height = 48;
+
+
outline-width = 0;
+
border-width = 0;
+
+
min-input-width = 100;
+
result-spacing = 20;
+
+
padding-top = 12;
+
padding-bottom = 12;
+
padding-left = 20;
+
padding-right = 20;
+
+
text-color = "#${base06}";
+
background-color = "#${base00}";
+
+
prompt-text = " ";
+
prompt-padding = 30;
+
prompt-background = "#${base01}";
+
prompt-background-padding = "5, 10";
+
prompt-background-corner-radius = 5;
+
+
input-color = "#${base07}";
+
input-background = "#${base01}";
+
input-background-padding = "5, 10";
+
input-background-corner-radius = 5;
+
+
selection-color = "#${base0E}";
+
selection-background = "#${base01}";
+
selection-background-padding = "5, 10";
+
selection-background-corner-radius = 8;
+
selection-match-color = "#${base08}";
+
+
clip-to-padding = false;
+
};
+
};
+
}
+1
modules/home-manager/default.nix
···
···
+
{ }
+6
modules/nixos/default.nix
···
···
+
# Add your reusable NixOS modules to this directory, on their own file (https://nixos.wiki/wiki/Module).
+
# These should be stuff you would like to share with others, not your personal configurations.
+
{
+
# List your module files here
+
# my-module = import ./my-module.nix;
+
}
+166
nixos/configuration.nix
···
···
+
{ inputs
+
, outputs
+
, lib
+
, config
+
, pkgs
+
, ...
+
}:
+
+
{
+
# Hardware is imported in the flake to be machine specific
+
+
nix = {
+
# This will add each flake input as a registry
+
# To make nix3 commands consistent with your flake
+
registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
+
+
# This will additionally add your inputs to the system's legacy channels
+
# Making legacy nix commands consistent as well, awesome!
+
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
+
+
gc = {
+
automatic = true;
+
dates = "weekly";
+
};
+
+
settings = {
+
experimental-features = [ "nix-command" "flakes" ];
+
auto-optimise-store = true;
+
};
+
};
+
+
nixpkgs = {
+
overlays = with outputs.overlays; [ additions modifications unstable-packages ];
+
config.allowUnfree = true;
+
};
+
+
hardware.opengl = {
+
enable = true;
+
driSupport = true;
+
};
+
+
boot.loader = {
+
systemd-boot.enable = true;
+
efi.canTouchEfiVariables = true;
+
};
+
+
security.pam.services.swaylock.text = "auth include login";
+
programs.dconf.enable = true;
+
+
services.blueman.enable = true;
+
+
# TODO: should be configurable
+
networking.hostName = "archaic-wiro-laptop";
+
networking.networkmanager.enable = true;
+
+
time.timeZone = "Europe/Paris";
+
+
i18n.defaultLocale = "en_US.UTF-8";
+
i18n.extraLocaleSettings = {
+
LC_ADDRESS = "fr_FR.UTF-8";
+
LC_IDENTIFICATION = "fr_FR.UTF-8";
+
LC_MEASUREMENT = "fr_FR.UTF-8";
+
LC_MONETARY = "fr_FR.UTF-8";
+
LC_NAME = "fr_FR.UTF-8";
+
LC_NUMERIC = "fr_FR.UTF-8";
+
LC_PAPER = "fr_FR.UTF-8";
+
LC_TELEPHONE = "fr_FR.UTF-8";
+
LC_TIME = "fr_FR.UTF-8";
+
};
+
+
fonts = {
+
fonts = with pkgs; [ (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) inter noto-fonts noto-fonts-emoji font-awesome ];
+
fontconfig = {
+
# Set `Noto Sans` as fallback font
+
defaultFonts = {
+
monospace = [ "JetBrainsMono Nerd Font" "Noto Sans" ];
+
sansSerif = [ "Inter" "Noto Sans" ];
+
serif = [ "Inter" "Noto Sans" ];
+
emoji = [ "Noto Color Emoji" ];
+
};
+
};
+
};
+
+
programs.fish.enable = true;
+
+
users.users.milomoisson = {
+
isNormalUser = true;
+
description = "Milo Moisson";
+
extraGroups = [ "networkmanager" "wheel" ];
+
shell = pkgs.fish;
+
packages = with pkgs; [ ];
+
+
openssh.authorizedKeys.keys = [
+
# TODO: Add your SSH public key(s) here, if you plan on using SSH to connect
+
];
+
};
+
+
services.udev.packages = with pkgs; [ numworks-udev-rules ];
+
+
security.sudo-rs.enable = true;
+
+
security.polkit.enable = true;
+
+
security.rtkit.enable = true;
+
+
services.pipewire = {
+
enable = true;
+
alsa.enable = true;
+
alsa.support32Bit = true;
+
pulse.enable = true;
+
jack.enable = true;
+
};
+
+
virtualisation.docker = {
+
enable = true;
+
rootless = {
+
enable = true;
+
setSocketVariable = true;
+
};
+
};
+
+
# TODO: see if it works on neo laptop
+
services.fprintd.enable = true;
+
+
services.gnome.gnome-keyring.enable = true;
+
+
# TODO: should not be here
+
programs.steam = {
+
enable = true;
+
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
+
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
+
};
+
+
services.upower.enable = true;
+
+
services.logind = {
+
lidSwitch = "lock";
+
lidSwitchDocked = "suspend";
+
lidSwitchExternalPower = "lock";
+
extraConfig = lib.generators.toKeyValue { } {
+
IdleAction = "lock";
+
# Don’t shutdown when power button is short-pressed
+
HandlePowerKey = "lock";
+
HandlePowerKeyLongPress = "suspend";
+
};
+
};
+
+
programs.gnupg.agent = {
+
enable = true;
+
enableSSHSupport = true;
+
};
+
+
services.openssh = {
+
enable = true;
+
settings = {
+
PermitRootLogin = "no";
+
PasswordAuthentication = false;
+
};
+
};
+
+
hardware.bluetooth.enable = true;
+
+
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
+
system.stateVersion = "23.05";
+
}
+
+44
nixos/hardware/archaic.nix
···
···
+
# Do not modify this file! It was generated by ‘nixos-generate-config’
+
# and may be overwritten by future invocations. Please make changes
+
# to /etc/nixos/configuration.nix instead.
+
{ config
+
, lib
+
, pkgs
+
, modulesPath
+
, ...
+
}: {
+
imports = [
+
(modulesPath + "/installer/scan/not-detected.nix")
+
];
+
+
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "sd_mod" "rtsx_pci_sdmmc" ];
+
boot.initrd.kernelModules = [ ];
+
boot.kernelModules = [ "kvm-intel" ];
+
boot.extraModulePackages = [ ];
+
+
fileSystems."/" = {
+
device = "/dev/disk/by-uuid/c3e74034-2dc2-4462-a4f1-82fc5f8e7daf";
+
fsType = "ext4";
+
};
+
+
fileSystems."/boot" = {
+
device = "/dev/disk/by-uuid/A18B-9B1D";
+
fsType = "vfat";
+
};
+
+
swapDevices = [
+
{ device = "/dev/disk/by-uuid/6206464f-5261-404c-b2f5-dbb450d30550"; }
+
];
+
+
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
+
# (the default) this is the recommended approach. When using systemd-networkd it's
+
# still possible to use this option, but it's recommended to use it in conjunction
+
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
+
networking.useDHCP = lib.mkDefault true;
+
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
+
# networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
+
+
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
+
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+
}
+17
overlays/default.nix
···
···
+
{ inputs, ... }: {
+
# This one brings our custom packages from the 'pkgs' directory
+
additions = final: _prev: import ../pkgs final;
+
+
# See https://nixos.wiki/wiki/Overlays
+
modifications = final: prev: {
+
# example = prev.example.overrideAttrs (oldAttrs: rec {});
+
};
+
+
# Makes the unstable nixpkgs set accessible through 'pkgs.unstable'
+
unstable-packages = final: _prev: {
+
unstable = import inputs.nixpkgs-unstable {
+
system = final.system;
+
config.allowUnfree = true;
+
};
+
};
+
}
+5
pkgs/default.nix
···
···
+
# Custom packages, that can be defined similarly to ones from nixpkgs
+
# You can build them using 'nix build .#example'
+
pkgs: {
+
thorium = pkgs.callPackage ./thorium.nix { };
+
}
+162
pkgs/thorium.nix
···
···
+
{ lib
+
, stdenv
+
, fetchurl
+
, autoPatchelfHook
+
, dpkg
+
, wrapGAppsHook
+
, alsa-lib
+
, at-spi2-atk
+
, at-spi2-core
+
, cairo
+
, cups
+
, curl
+
, dbus
+
, expat
+
, ffmpeg
+
, fontconfig
+
, freetype
+
, glib
+
, glibc
+
, gtk3
+
, gtk4
+
, libcanberra
+
, liberation_ttf
+
, libexif
+
, libglvnd
+
, libkrb5
+
, libnotify
+
, libpulseaudio
+
, libu2f-host
+
, libva
+
, libxkbcommon
+
, mesa
+
, nspr
+
, nss
+
, pango
+
, pciutils
+
, pipewire
+
, qt6
+
, speechd
+
, udev
+
, unrar
+
, vaapiVdpau
+
, vulkan-loader
+
, wayland
+
, wget
+
, xdg-utils
+
, xfce
+
, xorg
+
}:
+
+
stdenv.mkDerivation rec {
+
pname = "thorium-browser";
+
version = "117.0.5938.157";
+
+
src = fetchurl {
+
url = "https://github.com/Alex313031/thorium/releases/download/M${version}/thorium-browser_${version}_amd64.deb";
+
hash = "sha256-muNBYP6832PmP0et9ESaRpd/BIwYZmwdkHhsMNBLQE4=";
+
};
+
+
nativeBuildInputs = [
+
autoPatchelfHook
+
dpkg
+
wrapGAppsHook
+
qt6.wrapQtAppsHook
+
];
+
+
buildInputs = [
+
stdenv.cc.cc.lib
+
alsa-lib
+
at-spi2-atk
+
at-spi2-core
+
cairo
+
cups
+
curl
+
dbus
+
expat
+
ffmpeg
+
fontconfig
+
freetype
+
glib
+
glibc
+
gtk3
+
gtk4
+
libcanberra
+
liberation_ttf
+
libexif
+
libglvnd
+
libkrb5
+
libnotify
+
libpulseaudio
+
libu2f-host
+
libva
+
libxkbcommon
+
mesa
+
nspr
+
nss
+
qt6.qtbase
+
pango
+
pciutils
+
pipewire
+
speechd
+
udev
+
unrar
+
vaapiVdpau
+
vulkan-loader
+
wayland
+
wget
+
xdg-utils
+
xfce.exo
+
xorg.libxcb
+
xorg.libX11
+
xorg.libXcursor
+
xorg.libXcomposite
+
xorg.libXdamage
+
xorg.libXext
+
xorg.libXfixes
+
xorg.libXi
+
xorg.libXrandr
+
xorg.libXrender
+
xorg.libXtst
+
xorg.libXxf86vm
+
];
+
+
autoPatchelfIgnoreMissingDeps = [
+
"libQt5Widgets.so.5"
+
"libQt5Gui.so.5"
+
"libQt5Core.so.5"
+
];
+
+
installPhase = ''
+
runHook preInstall
+
+
mkdir -p $out
+
cp -r usr/* $out
+
cp -r etc $out
+
cp -r opt $out
+
ln -sf $out/opt/chromium.org/thorium/thorium-browser $out/bin/thorium-browser
+
rm $out/share/applications/thorium-shell.desktop
+
+
substituteInPlace $out/share/applications/thorium-browser.desktop \
+
--replace /usr/bin $out/bin \
+
--replace StartupWMClass=thorium StartupWMClass=thorium-browser \
+
--replace Icon=thorium-browser Icon=$out/opt/chromium.org/thorium/product_logo_256.png
+
+
addAutoPatchelfSearchPath $out/chromium.org/thorium
+
addAutoPatchelfSearchPath $out/chromium.org/thorium/lib
+
substituteInPlace $out/opt/chromium.org/thorium/thorium-browser \
+
--replace 'export LD_LIBRARY_PATH' "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${ lib.makeLibraryPath buildInputs }:$out/chromium.org/thorium:$out/chromium.org/thorium/lib" \
+
--replace /usr $out
+
+
runHook postInstall
+
'';
+
+
meta = with lib; {
+
description = "Compiler-optimized private Chromium fork";
+
homepage = "https://thorium.rocks/index.html";
+
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+
license = licenses.unfree;
+
platforms = [ "x86_64-linux" ];
+
mainProgram = "thorium-browser";
+
};
+
}
secrets/CA5E-pgp-key.age

This is a binary file and will not be displayed.

+5
secrets/default.nix
···
···
+
{ ... }: {
+
age.secrets = {
+
pgpkey.file = ./pgpkey.age;
+
};
+
}
+8
secrets/secrets.nix
···
···
+
let
+
old-neo = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINUkJvLMjjzbZSrnucc2uQeRhiuXPiZXNjqT80PVSSQb";
+
archaic = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHLLJ+6UiJYTD0HhWwTBom5fmZ4RaCXAUgcGaXgfdG8S";
+
systems = [ old-neo archaic ];
+
in
+
{
+
"CA5E-pgp-key.age".publicKeys = systems;
+
}