Personal NixOS desktop configuration and setup scripts
  • Nix 94.4%
  • Shell 5.6%
Find a file
2026-06-14 17:35:48 +03:00
scripts feat(nixos): add host deploy workflow 2026-06-09 20:29:31 +03:00
.gitignore Initial commit 2026-06-04 12:28:18 +00:00
aegis.nix feat(all) remove vscodium 2026-06-14 17:35:48 +03:00
flatpak_apps.md docs(nixos): update deployment workflow 2026-06-09 20:40:28 +03:00
LICENSE Initial commit 2026-06-04 12:28:18 +00:00
lotus.nix feat(all) remove vscodium 2026-06-14 17:35:48 +03:00
README.md docs(nixos): update deployment workflow 2026-06-09 20:40:28 +03:00

mynixconfig

Personal NixOS configuration files and deployment scripts.

This repository contains my personal NixOS configurations for my machines. The goal is to keep each host configuration versioned in Git, while deploying the correct host file to /etc/nixos/configuration.nix before running nixos-rebuild switch.

Repository contents

mynixconfig/
├── aegis.nix
├── lotus.nix
├── flatpak_apps.md
├── scripts/
│   └── deploy-current-host.sh
├── .gitignore
├── LICENSE
└── README.md

Files

aegis.nix

NixOS configuration for the desktop computer named aegis.

This file is deployed to:

/etc/nixos/configuration.nix

when the current machine hostname is aegis.

lotus.nix

NixOS configuration for the laptop named lotus.

This file is deployed to:

/etc/nixos/configuration.nix

when the current machine hostname is lotus.

scripts/deploy-current-host.sh

Deploy script for the current machine.

The script detects the current hostname with hostname -s, selects the matching host configuration from the repository, copies it to /etc/nixos/configuration.nix, and runs:

sudo nixos-rebuild switch

If a commit message is provided as the first argument, the script also commits the repository changes after a successful rebuild.

Example:

./scripts/deploy-current-host.sh "feat(nixos): update aegis configuration"

Without a commit message, the script deploys and rebuilds the system, but skips the Git commit:

./scripts/deploy-current-host.sh

flatpak_apps.md

Manual Flatpak application installation list.

Flatpak applications are installed manually instead of being managed directly through the NixOS configuration.

Usage

Start with a fresh NixOS installation.

Keep the generated hardware configuration:

sudo nixos-generate-config

Do not replace the generated machine-specific file:

/etc/nixos/hardware-configuration.nix

Clone this repository:

cd ~/Documents
git clone git@git.parametron.io:emreg/mynixconfig.git
cd mynixconfig

Make sure the deploy script is executable:

chmod +x scripts/deploy-current-host.sh

Deploy the configuration for the current host:

./scripts/deploy-current-host.sh

To deploy and commit in one step:

./scripts/deploy-current-host.sh "feat(nixos): update system configuration"

After reboot, install the Flatpak applications manually using the commands in:

flatpak_apps.md

Hostname-based deployment

The deployment script expects the current hostname to match a Nix file in the repository.

Examples:

aegis  -> aegis.nix
lotus  -> lotus.nix

If the current hostname does not have a matching file, deployment fails instead of copying the wrong configuration.

Configuration model

The repository is the source of truth for editable NixOS configuration files.

~/Documents/mynixconfig/<hostname>.nix
        ↓
/etc/nixos/configuration.nix
        ↓
sudo nixos-rebuild switch

/etc/nixos/configuration.nix is treated as the deployed system copy. Manual edits should be made in the repository host file instead.

Notes

This is a personal NixOS configuration repository. It is shared as a reference and may not be suitable for other machines.

Before applying it to another system, review the configuration carefully, especially:

  • hostname
  • user account settings
  • desktop environment settings
  • enabled services
  • installed packages
  • Flatpak application list
  • hardware-specific assumptions

Do not replace another machine's generated hardware-configuration.nix with a file from this repository.

License

This repository is licensed under the MIT License.

The configuration and scripts are provided as-is, without warranty. Use them at your own risk.