Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

My nix config for all my machines

License

NotificationsYou must be signed in to change notification settings

rasmus-kirk/nix-config

Repository files navigation

This repository contains my Nix configurations. Feel free to explore anduse any part that inspires you.

Features:

  • Single flake setup
  • Agenix for secrets management
  • Home-Manager integration
  • Modularization
  • Automatic module options documentation generation athttps://nix.rasmuskirk.com/
  • Pi-based NAS setup

Directions:

  • configurations/home-manager:
    • Home-Manager configurations for my devices (deck, Pi, and work).
  • configurations/nixos:
    • NixOS configurations for my devices (Pi).
  • modules/home-manager:
    • Home-Manager modules generalizing configuration for various tools.
  • modules/nixos:
    • NixOS modules generalizing configuration for various tools.
  • pubkeys:
    • Public keys for my devices.
  • docs:

The Configurations

The Home-Manager configurations are fairly straightforward since they mostlyreuse modules, but the NixOS configuration has some notable features:

  • Agenix for secrets management
  • Nixarr integration
  • Syncthing
  • SSH tunneling
  • Sudo insults

The Modules

The modules allow configuration to be reused efficiently and withoutduplication between machines. For example, I want to share configurationbetween my Pi-based NAS and my work laptop for programs such as my editor,file manager, git, shell and more.

An example follows below:

Snippet from Work Laptop's Configuration

kirk={helix.enable=true;yazi={enable=true;configDir=configDir;};git={enable=true;userEmail="mail@rasmuskirk.com";userName="rasmus-kirk";};zsh.enable=true;fonts.enable=true;terminalTools.enable=true;};

Snippet from NAS/Pi Configuration

kirk={helix={enable=true;installMostLsps=false;extraPackages=withpkgs;[nilmarksmannodePackages_latest.bash-language-server];};yazi={enable=true;configDir=configDir;};git={enable=true;userEmail="mail@rasmuskirk.com";userName="rasmus-kirk";};zsh.enable=true;fonts.enable=true;terminalTools.enable=true;};

Importing Modules

The options I’ve created allow for different behaviors across devices, whileavoiding redundant configuration snippets. Although these modules are designedfor personal use, it's possible for others to reuse them:

{description="My NixOS configuration";inputs={nixpkgs.url="github:nixos/nixpkgs/nixos-unstable";kirk-modules.url="github:rasmus-kirk/nix-config";kirk-modules.inputs.nixpkgs.follows="nixpkgs";home-manager.url="github:nix-community/home-manager/release-23.11";home-manager.inputs.nixpkgs.follows="nixpkgs";};outputs=inputs @{self,nixpkgs,kirk-modules,flake-parts,    ...}:letinherit(self)outputs;in{homeConfigurations={myMachine=home-manager.lib.homeManagerConfiguration{pkgs=nixpkgs.legacyPackages.x86_64-linux;extraSpecialArgs={inheritinputsoutputs;};modules=[./configurations/home-manager/my-machine/home.nixkirk-modules.homeManagerModules.default];};};};}

Automatically Generated Module Documentation

The Nix modules include built-in compilation of module options toMarkdown. I further convert this Markdown into HTML using Pandoc, whichis then deployed via GitHub Pages. You can find the module documentationhere. For more details, see the./docsdirectory.


[8]ページ先頭

©2009-2025 Movatter.jp