{"id":19938614,"url":"https://github.com/sectore/dotfiles","last_synced_at":"2025-09-05T12:40:16.265Z","repository":{"id":66673205,"uuid":"65619628","full_name":"sectore/dotfiles","owner":"sectore","description":"personal dotfiles","archived":false,"fork":false,"pushed_at":"2025-02-22T17:44:41.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-22T18:32:21.535Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sectore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-13T13:53:39.000Z","updated_at":"2025-02-22T17:44:45.000Z","dependencies_parsed_at":"2023-03-09T08:31:08.138Z","dependency_job_id":"5dbd9e4f-6484-4c4d-99b1-d91ab26c68dd","html_url":"https://github.com/sectore/dotfiles","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sectore%2Fdotfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sectore%2Fdotfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sectore%2Fdotfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sectore%2Fdotfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sectore","download_url":"https://codeload.github.com/sectore/dotfiles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241367932,"owners_count":19951444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T23:41:21.421Z","updated_at":"2025-09-05T12:40:16.210Z","avatar_url":"https://github.com/sectore.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dotfiles\n\n## `Nix` + `Home Manager` on `Ubuntu`\n\n### Install Nix\n\n:eyes: Multi-user installation (recommended) https://nixos.org/download.html#nix-quick-install\n\n\n### Enable `Flakes`\n\n:eyes: https://nixos.wiki/wiki/Flakes#Permanent\n\n:eyes: [nix/README](./nix/README)\n\n\n### Install standalone `Home Manager`\n\n:eyes: https://nix-community.github.io/home-manager/index.xhtml#sec-install-standalone\n\n```sh\nnix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager\nnix-channel --update\n\nnix-shell '\u003chome-manager\u003e' -A install\n```\n\nCheck installation\n\n```sh\nnix-env --query --installed\nhome-manager-path\n\n# or\n\nhome-manager --version\n25.05-pre\n```\n\n### Checkout and symlink dotfiles\n\n```sh\ngit pull git@github.com:sectore/dotfiles.git\ncd dotfiles\n```\n\nSymlink `home-manager`, `nix` and `zed` folder to `~/.config` using [stow](https://www.gnu.org/software/stow/manual/stow.html#Introduction) based on YT vid [Stow has forever changed the way I manage my dotfiles](https://www.youtube.com/watch?v=y6XCebnB9gs)\n\n```sh\nstow . -t ~/.config\n```\n\nSide note: `home-manager` provides [`programs.zed-editor`](https://nix-community.github.io/home-manager/options.xhtml#opt-programs.zed-editor.enable),\nbut it errors while creating symlinks to `settings.json` etc., which Zed tries to override. That ends in errors such as\n```sh\nPermission denied (os error 13) at path \"/nix/store/...\"\n# or\nFailed to write settings to file \"/nix/store/xxr...-zed-user-settings\"\n```\nVery similar to https://github.com/zed-industries/zed/issues/16618\n\nSolution is just to add `pkgs.zed-editor` to `home.packages` and symlink Zed's settings files etc. located in `~/dotfiles/zed/` by using `stow`.\n\nActivate configuration of `home-manager` after setup or any future changes:\n\n```sh\nhome-manager switch\n```\n\n### Configuration of Home Manager and programs\n\n- Packages https://search.nixos.org/packages?channel=unstable\n- Configuration Options\n   - https://nix-community.github.io/home-manager/options.html\n   - https://mipmip.github.io/home-manager-option-search/\n\n### Change default shell to `zsh`\n\nHome Manager can't change the default shell, so we need to do it manually:\n\n```sh\n# `which zsh`\nwhich zsh\n~/.nix-profile/bin/zsh\n\n# add it to `/etc/shells`\nsudo vi /etc/shells\n\n# change shell to `zsh`\nchsh -s ~/.nix-profile/bin/zsh\n```\nReference:\n   - How to make ZSH the default shell? https://askubuntu.com/a/1054798\n   - Change my default shell in Linux using chsh https://www.cyberciti.biz/faq/change-my-default-shell-in-linux-using-chsh/\n\n### `NixGL`\n\n\u003e To access the GPU, programs need access to OpenGL and Vulkan libraries. While this works transparently on NixOS, it does not on other Linux systems. A solution is provided by NixGL, which can be integrated into Home Manager.\n\n^ https://nix-community.github.io/home-manager/index.xhtml#sec-usage-gpu-non-nixos\n\nNeeded to run [`Zed`](https://zed.dev), [`Ghostty`](https://ghostty.org), [`Bevy`](https://bevyengine.org) etc.\n\nFrom [Bevy's docs](https://github.com/bevyengine/bevy/blob/main/docs/linux_dependencies.md#nix):\n\n\u003e If running nix on a non NixOS system (such as ubuntu, arch etc.), NixGL is additionally required, to link graphics drivers into the context of software installed by nix.\n\n`nixGL` is provided as an `input` in `home-manager/flake.nix` and configured in `home-manager/modules/nixgl.nix` based on `Home Managers` manual [\"GPU on non-NixOS systems\"](https://github.com/nix-community/home-manager/blob/master/docs/manual/usage/gpu-non-nixos.md).\n\nPrograms can be wrapped with it `config.lib.nixGL.wrappers.nvidia`  (see `zed-editor` in `home-manager/home.nix`) or with `config.lib.nixGL.wrap` (see `Ghostty` in `home-manager/modules/terminal.nix`).\n\n### `apparmor` profiles\n\nUbuntu 24.04 introduced security improvements, such as [Unprivileged user namespace restrictions](https://discourse.ubuntu.com/t/ubuntu-24-04-lts-noble-numbat-release-notes/39890#p-99950-unprivileged-user-namespace-restrictions) in combinination with the `apparmor` package.\n\nPrograms installed by `Home Manager` might missing such profiles and throwing errors such as:\n\n```sh\n❯ discord\n[Nix] Disabling updates already done\n[67961:0801/152728.026170:FATAL:setuid_sandbox_host.cc(163)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /nix/store/{hash}-discord-0.0.{version}/opt/Discord/chrome-sandbox is owned by root and has mode 4755.\n```\n\n### Fix\n\n1. [Create an `appamor` profile](https://documentation.ubuntu.com/server/how-to/security/apparmor/index.html#create-a-profile) for such program, e.g. `discord`:\n\n```sh\nsudo vi /etc/apparmor.d/discord\n```\n\n2. Add following content:\n\n```sh\nabi \u003cabi/4.0\u003e,\ninclude \u003ctunables/global\u003e\n\nprofile discord /nix/store/*-discord-*/**/* flags=(unconfined) {\n  userns,\n}\n```\n\n3. Load profile into the kernel:\n\n```sh\nsudo apparmor_parser -r /etc/apparmor.d/discord\n```\nMore `apparmor` [commands](https://documentation.ubuntu.com/server/how-to/security/apparmor/index.html#common-commands).\n\n4. Reload all profiles\n\n```sh\nsudo systemctl reload apparmor.service\n```\n\nDone.\n\n### Acknowledge\n\n- NixOS Wiki: [Flakes](https://nixos.wiki/wiki/Flakes)\n- Home Manager: [Documentation](https://nix-community.github.io/home-manager/)\n- Zero to Flakes: [Using direnv to manage dev environments](https://zero-to-flakes.com/direnv)\n- Johannes Schickling: [Setting up Nix on macOS from scratch (incl. dotfiles via home-manager and Nix flakes)](https://www.youtube.com/watch?v=1dzgVkgQ5mE)\n- Vimjoyer: [Nix home-manager tutorial: Declare your entire home directory](https://www.youtube.com/watch?v=FcC2dzecovw\u0026list=PLko9chwSoP-15ZtZxu64k_CuTzXrFpxPE\u0026index=4)\n- Alex Pearce: [Managing dotfiles with Nix](https://alexpearce.me/2021/07/managing-dotfiles-with-nix/)\n- Red Tomato: [My Nix Journey - Use Nix on Ubuntu](https://tech.aufomm.com/my-nix-journey-use-nix-with-ubuntu/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsectore%2Fdotfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsectore%2Fdotfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsectore%2Fdotfiles/lists"}