feat: devshells, formatting, zoxide

This commit is contained in:
Henri Saudubray 2025-12-16 16:42:34 +01:00
parent d4ca1cffd2
commit 989f834aa9
9 changed files with 205 additions and 72 deletions

1
README.md Normal file
View file

@ -0,0 +1 @@
# Nixos configuration

27
devshells/ocaml/flake.lock generated Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1765762245,
"narHash": "sha256-3iXM/zTqEskWtmZs3gqNiVtRTsEjYAedIaLL0mSBsrk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c8cfcd6ccd422e41cc631a0b73ed4d5a925c393d",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-25.11",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

33
devshells/ocaml/flake.nix Normal file
View file

@ -0,0 +1,33 @@
{
description = "OCaml nix-flake devshell.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
};
outputs =
{ self, nixpkgs, ... }:
let
system = "x86_64-linux";
in
{
devShells."${system}".default =
let
pkgs = import nixpkgs {
inherit system;
};
in
pkgs.mkShell {
packages =
with pkgs;
with ocamlPackages;
[
findlib
ocaml
ocaml-lsp
ocamlformat
dune_3
];
};
};
}

27
devshells/why3/flake.lock generated Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1765779637,
"narHash": "sha256-KJ2wa/BLSrTqDjbfyNx70ov/HdgNBCBBSQP3BIzKnv4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "1306659b587dc277866c7b69eb97e5f07864d8c4",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

31
devshells/why3/flake.nix Normal file
View file

@ -0,0 +1,31 @@
{
description = "Why3 nix-flake devshell.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs =
{ self, nixpkgs, ... }:
let
system = "x86_64-linux";
in
{
devShells."${system}".default =
let
pkgs = import nixpkgs { inherit system; };
in
pkgs.mkShell {
packages = with pkgs; [
why3
alt-ergo
z3
cvc5
];
shellHook = ''
why3 config detect
'';
};
};
}

View file

@ -7,12 +7,15 @@
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = { nixpkgs, home-manager, ... }: { outputs =
{ nixpkgs, home-manager, ... }:
{
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
./nixos/configuration.nix ./nixos/configuration.nix
home-manager.nixosModules.home-manager { home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.hms = ./home-manager/home.nix; home-manager.users.hms = ./home-manager/home.nix;

View file

@ -13,19 +13,22 @@
ripgrep ripgrep
just just
tealdeer tealdeer
zoxide
# Applications # Applications
blackbox-terminal
zotero zotero
zulip zulip
discord discord
signal-desktop signal-desktop
sgt-puzzles # sgt-puzzles
gapless gapless
# Development # Development
opam opam
tinymist tinymist
nixfmt-rfc-style nixfmt-rfc-style
nil
]; ];
shell.enableBashIntegration = true; shell.enableBashIntegration = true;
@ -49,7 +52,9 @@
lsp.display-messages = true; lsp.display-messages = true;
inline-diagnostics.cursor-line = "info"; inline-diagnostics.cursor-line = "info";
rulers = [ 81 ]; rulers = [ 81 ];
gutters.layout = [ "diagnostics" ];
}; };
keys.insert.j.k = "normal_mode";
}; };
}; };
bat.enable = true; bat.enable = true;
@ -68,10 +73,14 @@
enable = true; enable = true;
bashrcExtra = '' bashrcExtra = ''
export PS1=" \W \[\e[33m\]λ\[\e[0m\] " export PS1=" \W \[\e[33m\]λ\[\e[0m\] "
test -r '/home/hms/.opam/opam-init/init.sh' && . '/home/hms/.opam/opam-init/init.sh' > /dev/null 2> /dev/null || true
''; '';
}; };
gpg.enable = true; gpg.enable = true;
zoxide = {
enable = true;
enableBashIntegration = true;
options = [ "--cmd cd" ];
};
}; };
xdg.userDirs = { xdg.userDirs = {

View file

@ -1,12 +1,7 @@
# Edit this configuration file to define what should be installed on { pkgs, ... }:
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{ {
imports = imports = [
[
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
@ -20,20 +15,13 @@
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
}; };
kernelPackages = pkgs.linuxPackages_latest; kernelPackages = pkgs.linuxPackages_latest;
initrd.luks.devices."luks-374c6259-18c4-462b-9f30-9c9648de00ae".device = "/dev/disk/by-uuid/374c6259-18c4-462b-9f30-9c9648de00ae"; initrd.luks.devices."luks-374c6259-18c4-462b-9f30-9c9648de00ae".device =
"/dev/disk/by-uuid/374c6259-18c4-462b-9f30-9c9648de00ae";
}; };
networking = { networking = {
hostName = "nixos"; hostName = "nixos";
networkmanager.enable = true; networkmanager.enable = true;
wireless.networks.eduroam = {
auth = ''
key_mgmt=WPA-EAP
eap=PWD
identity="henri.saudubray@universite-paris-saclay.fr"
password=""
'';
};
}; };
# Set your time zone. # Set your time zone.
@ -90,21 +78,20 @@
users.users.hms = { users.users.hms = {
isNormalUser = true; isNormalUser = true;
description = "hms"; description = "hms";
extraGroups = [ "networkmanager" "wheel" ]; extraGroups = [
packages = with pkgs; []; "networkmanager"
"wheel"
];
packages = [ ];
}; };
# Install firefox.
programs.firefox.enable = true; programs.firefox.enable = true;
nixpkgs = { nixpkgs = {
overlays = [ ]; overlays = [ ];
# Allow unfree packages
config.allowUnfree = true; config.allowUnfree = true;
}; };
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
helix helix
wget wget
@ -113,7 +100,7 @@
gnomeExtensions.clipboard-indicator gnomeExtensions.clipboard-indicator
gnomeExtensions.rounded-window-corners-reborn gnomeExtensions.rounded-window-corners-reborn
gnomeExtensions.runcat gnomeExtensions.runcat
nerd-fonts.caskaydia-cove nerd-fonts.adwaita-mono
adw-gtk3 adw-gtk3
gnumake gnumake
clang clang
@ -121,13 +108,10 @@
xclip xclip
]; ];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
programs.gnupg.agent = { programs.gnupg.agent = {
enable = true; enable = true;
enableSSHSupport = true; enableSSHSupport = true;
}; };
system.stateVersion = "25.11"; # Did you read the comment? system.stateVersion = "25.11";
} }

View file

@ -1,33 +1,51 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
modulesPath,
...
}:
{ {
imports = imports = [
[ (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "vmd" "nvme" "usb_storage" "usbhid" "sd_mod" "rtsx_pci_sdmmc" ]; boot.initrd.availableKernelModules = [
"xhci_pci"
"thunderbolt"
"vmd"
"nvme"
"usb_storage"
"usbhid"
"sd_mod"
"rtsx_pci_sdmmc"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/mapper/luks-de976821-5bfe-4c34-92ff-5d4d607e42c4"; device = "/dev/mapper/luks-de976821-5bfe-4c34-92ff-5d4d607e42c4";
fsType = "ext4"; fsType = "ext4";
}; };
boot.initrd.luks.devices."luks-de976821-5bfe-4c34-92ff-5d4d607e42c4".device = "/dev/disk/by-uuid/de976821-5bfe-4c34-92ff-5d4d607e42c4"; boot.initrd.luks.devices."luks-de976821-5bfe-4c34-92ff-5d4d607e42c4".device =
"/dev/disk/by-uuid/de976821-5bfe-4c34-92ff-5d4d607e42c4";
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/6137-E7B4"; device = "/dev/disk/by-uuid/6137-E7B4";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ]; options = [
"fmask=0077"
"dmask=0077"
];
}; };
swapDevices = swapDevices = [
[ { device = "/dev/mapper/luks-374c6259-18c4-462b-9f30-9c9648de00ae"; } { device = "/dev/mapper/luks-374c6259-18c4-462b-9f30-9c9648de00ae"; }
]; ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";