Giter VIP home page Giter VIP logo

nix-config's Introduction

NixOS & Home Manager Configurations

based from wimpysworld nix-config

This repository contains a Nix Flake for configuring my computers and home environment. These are the computers this configuration currently manages:

Hostname OEM Model OS Role Status
boojum Lenovo Thinkpad Gen 6 NixOS Laptop working
jryjack Apple Macbook Pro M1 2020 macOS Laptop tbn
cork WSL2 VM VM tbn
maple Pine64 RockPro64 NixOS NAS working
ash Clockworkpi uConsole (CM-4, 4G Module) TBD Handheld tbn

Structure

The nixos/_mixins and home-manager/_mixins are a collection of composited configurations based on the arguments defined in flake.nix.

Installing

  • Boot off a .iso image created by this flake using rebuild-iso-desktop or rebuild-iso-console (see below)
  • Put the .iso image on a USB drive
  • Boot the target computer from the USB drive
  • Two installation options are available: 1 Use the graphical Calamares installer to install an adhoc system 2 Run install-system <hostname> <username> from a terminal
    • The install script uses Disko to automatically partition and format the disks, then uses my flake via nixos-install to complete a full-system installation
    • This flake is copied to the target user's home directory as ~/workspace/personal/nix-config
  • Reboot
  • Login and run rebuild-home (see below) from a terminal to complete the Home Manager configuration.

If the target system is booted from something other than the .iso image created by this flake, you can still install the system using the following:

curl -sL https://raw.githubusercontent.com/jacbart/nix-config/main/scripts/install.sh | bash -s <hostname> <username>

Applying Changes

I clone this repo to ~/workspace/personal/nix-config. NixOS and Home Manager changes are applied separately because I have some non-NixOS hosts.

gh repo clone jacbart/nix-config ~/workspace/personal/nix-config

NixOS

A rebuild-host alias is provided that does the following:

sudo nixos-rebuild switch --flake $HOME/workspace/personal/nix-config

Home Manager

A rebuild-home alias is provided that does the following:

home-manager switch -b backup --flake $HOME/workspace/personal/nix-config

ISO

Aliases for rebuild-iso-desktop (desktop) and rebuild-iso-console (console only) are provided that create .iso images from this flake. They do the following:

pushd $HOME/workspace/personal/nix-config
nix build .#nixosConfigurations.iso.config.system.build.isoImage
popd

A live image will be left in ~/$HOME/workspace/personal/nix-config/result/iso/. These .iso images are also periodically built and published via GitHub Actions and available in this project's Releases.

Structure

Here is the directory structure I'm using.

.
├── home-manager
│   ├── _mixins
│   │   ├── console
│   │   ├── desktop
│   │   ├── services
│   │   └── users
│   └── default.nix
├── nixos
│   ├── _mixins
│   │   ├── desktop
│   │   ├── hardware
│   │   ├── services
│   │   ├── users
│   │   └── virt
│   ├── iso
│   └── default.nix
├── overlays
├── pkgs
├── scripts
└── flake.nix

Before preparing my NixOS and Home Manager configurations I took a look at what other Nix users are doing. My colleagues shared their configs and tips which included nome from Luc Perkins, nixos-config from Cole Helbling, flake from Ana Hoverbear and her Declarative GNOME configuration with NixOS blog post. A couple of friends also shared their configurations and here's Jon Seager's nixos-config and Aaron Honeycutt's nix-configs.

While learning Nix I watched some talks/interviews with Matthew Croughan and Will Taylor's Nix tutorials on Youtube. Will Taylor's dotfiles are worth a look, as are his videos, and Matthew Croughan's nixcfg is also a useful reference. After I created my initial flake I found nix-starter-configs by Gabriel Fontes which is an excellent starting point. I'll be incorporating many of the techniques it demonstrates in my nix-config.

I like the directory hierarchy in Jon Seager's nixos-config and the mixin pattern used in Matthew Croughan's nixcfg, so my initial Nix configuration is heavily influenced by both of those. Ana's excellent Declarative GNOME configuration with NixOS blog post was essential to get a personalised desktop. That said, there's plenty to learn from browsing other people's Nix configurations, not least for discovering cool software. I recommend a search of GitHub nixos configuration from time to time to see what interesting techniques you pick up and new tools you might discover.

The Disko implementation and automated installation is chasing the ideas outlined in these blog posts:


https://wiki.nixos.org/wiki/I3 https://jacobneplokh.com/how-to-setup-nextcloud-on-nixos/ https://github.com/fufexan/dotfiles https://wiki.lightcrimson.com/en/garuda-sway-config/hyprland-keybinds

nix-config's People

Contributors

jacbart avatar dependabot[bot] avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.