{"id":16690229,"url":"https://github.com/l-lin/dotfiles","last_synced_at":"2025-04-10T00:50:26.842Z","repository":{"id":12789187,"uuid":"15462859","full_name":"l-lin/dotfiles","owner":"l-lin","description":":octocat:","archived":false,"fork":false,"pushed_at":"2024-10-23T15:10:13.000Z","size":10577,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-23T19:18:03.217Z","etag":null,"topics":["dotfiles","hyprland","neovim","nixos-dotfiles"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/l-lin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2013-12-27T00:10:21.000Z","updated_at":"2024-10-23T15:10:17.000Z","dependencies_parsed_at":"2023-12-27T22:25:03.490Z","dependency_job_id":"421f16d4-e509-411f-bcc7-2ffd679ab4f9","html_url":"https://github.com/l-lin/dotfiles","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l-lin%2Fdotfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l-lin%2Fdotfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l-lin%2Fdotfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l-lin%2Fdotfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/l-lin","download_url":"https://codeload.github.com/l-lin/dotfiles/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137997,"owners_count":21053775,"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":["dotfiles","hyprland","neovim","nixos-dotfiles"],"created_at":"2024-10-12T15:50:47.984Z","updated_at":"2025-04-10T00:50:26.831Z","avatar_url":"https://github.com/l-lin.png","language":"Shell","readme":"# Dotfiles\n\n\u003csummary\u003e:snowflake: NixOS\u003c/summary\u003e\n\u003cdetails\u003e\n\n- :bento: window manager: [hyprland](https://github.com/hyprwm/Hyprland)\n- :ghost: terminal emulator: [ghostty](https://ghostty.org/)\n- :shell: shell: [zsh](https://www.zsh.org/)\n- :memo: text editor: [neovim](https://neovim.io/)\n- :speech_balloon: notification: [dunst](https://dunst-project.org/)\n- :globe_with_meridians: browser: [zen](https://zen-browser.app/)\n- :camera: screenshot: [satty](https://github.com/gabm/Satty) + [grim](https://github.com/emersion/grim) + [slurp](https://github.com/emersion/slurp)\n- :video_camera: screen recorder: [wf-recorder](https://github.com/ammen99/wf-recorder) + [slurp](https://github.com/emersion/slurp)\n- :abc: fonts: [nerd fonts](https://github.com/ryanoasis/nerd-fonts)\n- :art: color scheme: [kanagawa](https://github.com/rebelot/kanagawa.nvim)\n- :file_folder: file manager: [yazi](https://yazi-rs.github.io/) / [thunar](https://gitlab.xfce.org/xfce/thunar)\n- :rocket: application launcher: [rofi](https://github.com/lbonn/rofi)\n\n\u003c/details\u003e\n\n\u003csummary\u003e:penguin: Ubuntu\u003c/summary\u003e\n\u003cdetails\u003e\n\n- :bento: window manager: [awesomewm](https://awesomewm.org/)\n- :ghost: terminal emulator: [ghostty](https://ghostty.org/)\n- :shell: shell: [zsh](https://www.zsh.org/)\n- :memo: text editor: [neovim](https://neovim.io/)\n- :globe_with_meridians: browser: [zen](https://zen-browser.app/)\n- :art: color scheme: [kanagawa](https://github.com/rebelot/kanagawa.nvim)\n- :file_folder: file manager: [yazi](https://yazi-rs.github.io/) / [thunar](https://gitlab.xfce.org/xfce/thunar)\n\n\u003c/details\u003e\n\n\u003csummary\u003e:apple: MacOS\u003c/summary\u003e\n\u003cdetails\u003e\n\n- :bento: window manager: [aerospace](https://github.com/nikitabobko/AeroSpace)\n- :ghost: terminal emulator: [ghostty](https://ghostty.org/)\n- :shell: shell: [zsh](https://www.zsh.org/)\n- :memo: text editor: [neovim](https://neovim.io/)\n- :globe_with_meridians: browser: [zen](https://zen-browser.app/)\n- :art: color scheme: [kanagawa](https://github.com/rebelot/kanagawa.nvim)\n- :file_folder: file manager: [yazi](https://yazi-rs.github.io/) / [thunar](https://gitlab.xfce.org/xfce/thunar)\n\n\u003c/details\u003e\n\n## Getting started\n\n```bash\n# list all available operations\nmake help\n```\n\n```bash\n$ # folder description\n$ nix-shell -p tree --run 'tree -d -L 1'\n.\n├── home-manager # Install and configure package at user level.\n├── nixos        # Install and configure package at system level.\n├── pkgs         # Contains Nix custom packages that are not present in nixpkgs.\n├── scripts      # Contains some Nix scripts to be use in home-manager or NixOS configuration files, as well as some shell scripts to use outside of Nix.\n└── stow         # Configuration files that need to be writeable are symlinked in this folder.\n```\n\n### Fresh installation\n#### Installation per distribution\n\n\u003csummary\u003e:snowflake: NixOS\u003c/summary\u003e\n\u003cdetails\u003e\n\n```bash\n# Clone dotfiles.\nnix-shell -p git just\ncd ~/.config\ngit clone https://github.com/l-lin/dotfiles\ncd dotfiles\n\n# Install everything.\njust import-keys import-secrets\njust update-nixos\njust update-home\nreboot\n```\n\n\u003c/details\u003e\n\n\u003csummary\u003e:penguin: Ubuntu\u003c/summary\u003e\n\u003cdetails\u003e\n\n```bash\n# Install curl: https://zero-to-nix.com/start/install.\nsudo apt install curl\n# Install Nix.\ncurl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install\n\n# Clone dotfiles.\nnix-shell -p git just\ncd ~/.config\ngit clone https://github.com/l-lin/dotfiles\ncd dotfiles\n\n# Install everything.\njust import-keys import-secrets\njust install-home-standalone\njust update-home\nreboot\n```\n\n\u003c/details\u003e\n\n\u003csummary\u003e:apple: MacOS\u003c/summary\u003e\n\u003cdetails\u003e\n\n```bash\n# Install homebrew: https://brew.sh/.\n/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"\n# Install Nix.\ncurl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install\n\n# Clone dotfiles.\nnix-shell -p git just\ncd ~/.config\ngit clone https://github.com/l-lin/dotfiles\ncd dotfiles\n\n# Install everything.\njust import-keys import-secrets\njust install-home-standalone\njust update-nix-darwin\njust update-home\n```\n\n\u003c/details\u003e\n\n#### Things to do after installation\n\n```bash\n# Add navi cheatsheets.\nunleash-the-keys\njust install-cheatsheets\n\n# Synchronize atuin\natuin login -u l-lin\natuin sync\n\n# Fix dotfiles git remote to use ssh.\nwd dotfiles\ngit remote remove origin \u0026\u0026 git remote add origin git@github.com:l-lin/dotfiles \u0026\u0026 git fetch\n\n# Clone your notes.\ngit clone --recurse-submodules git@github:l-lin/notes \"${HOME}/perso/notes\"\n\n# Configure Github CLI.\njust configure-gh\n\n# Configure jira CLI.\njira init\n\n# Configure colima to work with testcontainers\njust configure-colima\n```\n\nFor macOS:\n\n- Remove keyboard shortcut for dictation (default shortcut is making me popup a notification every now and then).\n  - `System settings \u003e Keyboard \u003e Dictation`\n- Remove `Ctrl+FX` keyboard shortcuts (otherwise, they won't be usable in nvim).\n  - `System settings \u003e Keyboard \u003e Keyboard shortcut \u003e Keyboard: disable all`\n- Change screenshot keymap to `cmd-s` and `cmd-shift-s`.\n  - `System settings \u003e Keyboard shortcut \u003e Screenshot`\n- Install Tridactyl native by executing `:nativeinstall` in your browser.\n- Change keyboard layout (may require a reboot).\n  - `System settings \u003e Keyboard \u003e Text input \u003e Edit`: Click on `+`, select `Other` and then `us-altgr-intl`\n- Add ghostty to control the computer so that `osascript` can send keystrokes for reloading ghostty configuration.\n  - `System settings \u003e Privacy \u0026 security \u003e Accessibility`: add ghostty\n- Remove sound effects.\n  - `System settings` \u003e Sound \u003e Sound effects`\n\n---\n\n## Notes to my future self\n\n:wave: Hello, my future self. Yes, you! Here are some notes for you, as I know\nyou are forgetful.\n\n- [Find a package in the Nixpkgs](https://l-lin.github.io/nix/find-a-package-in-the-Nixpkgs).\n- [Install a new package in home-manager](https://l-lin.github.io/nix/home-manager/install-a-new-package-in-home-manager).\n- [Install Forticlient VPN with SAML](https://l-lin.github.io/nix/install-Forticlient-VPN-with-SAML-in-NixOS)\n- [Add shell script available in `$PATH` in NixOS](https://l-lin.github.io/nix/add-shell-script-available-in-PATH-in-NixOS)\n- [Adding external binary to your `$PATH`](https://l-lin.github.io/nix/add-external-binary-in-PATH-in-NixOS)\n- [I want to downgrade/upgrade a package](https://l-lin.github.io/nix/downgrade-or-upgrade-a-package-in-NixOS)\n- [Use a different version of nixpkgs in home-manager](https://l-lin.github.io/nix/home-manager/use-different-version-of-nixpkgs-in-home-manager)\n- [Share variables between modules](https://l-lin.github.io/nix/share-variables-between-Nix-modules)\n- [Running an external binary on NixOS](https://l-lin.github.io/nix/running-an-external-binary-on-NixOS)\n- [XDG folder names and home directory as variables](https://l-lin.github.io/nix/nix-xdg-folder-names-and-home-directory-as-variables)\n- [Pair bluetooth devices](https://l-lin.github.io/unix/pair-bluetooth-devices)\n\n### Some packages are broken after an upgrade\n\nIf you are living dangerously, i.e. you are using the unstable version of `nixpkgs`,\neach package may be upgraded to their latest version. So you may have some packages\nthat are not behaving the same as you wanted or are just broken.\n\nHere's a tutorial of someone that used `git bisect` to find and fix his issue:\nhttps://ipetkov.dev/blog/bisecting-nix-configurations/.\n\n### Symlink configuration files whenever you can\n\nThere's a \"Nix way\" of configuring package. It is like a good abstraction, but\nyou **will prefer** to have your configuration in the original format and create\nsymlinks on them.\n\nThere are several advantages of doing like this:\n\n- you can refer to the package documentation to make your modification\n- you can use linter/treesitter/lsp/whatever on the configuration file\n- in case you change your OS (once again), you will still be able to re-use your dotfiles\n\nHowever, you will not be able to use Nix variables. So if the package does not\nneed to have any Nix variable, you can configure your package like this:\n\n```nix\n# Create symlink on the whole config/ folder on `~/.config/nvim`.\nxdg.configFile.nvim = {\n  source = ./config;\n  recursive = true;\n};\n\n# Create a symlink on a single file at `~`.\nhome.file.\".gitconfig\".source = ./config/.gitconfig;\n\n# If you need to use some Nix option along with the configuration file, you\n# can use the Nix builtin function `builtins.readFile`\nprograms.tmux = {\n  enable = true;\n  shell = \"${pkgs.zsh}/bin/zsh\";\n  extraConfig = ''\n    ${builtins.readFile ./.tmux.conf}\n  '';\n};\n\n# If you need to write text directly in the nix file, because you need to use\n# some nix variable:\nxdg.configFile.\"waybar/colorscheme.css\".text = ''\n@define-color fg #${palette.base05};\n@define-color fg-alt #${palette.base00};\n@define-color bg #${palette.base00};\n@define-color bg-alt #${palette.base0D};\n'';\n```\n\nI know you will think there's no consistency, sometimes I'm using Nix to configure\napplications, sometimes, I use symlink... I wonder if I should just use Nix / home-manager\nto handle all the package installation stuff and symlink the configuration files...\nOnly time will tell.\n\n### LazyVim configuration\n\n\u003e [!NOTE]\n\u003e [LazyVim](https://github.com/LazyVim/LazyVim) is a plugin manager that will download\n\u003e the plugins at \"runtime\". So it does not quite stick to the NixOS philosophy.\n\u003e It's recommended to migrate to something else, like configuring directly in\n\u003e [home-manager](https://mynixos.com/home-manager/options/programs.neovim), or using\n\u003e [NixVim](https://github.com/nix-community/nixvim) instead.\n\nI'm using a symlink to the `${XDG_CONFIG_HOME}/nvim` folder, so LazyVim works\nwithout much issue, i.e. it will download the plugins, but I can't say the same\nabout plugins that use downloaded binaries, e.g. LSP servers installed by [mason.nvim](https://github.com/williamboman/mason.nvim).\n\nI installed and configured [nix-ld](https://github.com/Mic92/nix-ld), so most binaries\nshould work without any problem. If not please check below on how to configure it.\n\nI still don't know if I want to migrate NeoVim to be fully Nix compliant or keep\nit like this...\n\n\u003e [!NOTE]\n\u003e I moved all my NeoVim configuration to the `stow/` folder, as updating a NeoVim Lua\n\u003e file through home-manager resulted in slow feedback (~20s).\n\n### Styling\n\nI used [stylix](https://github.com/danth/stylix) to manage color schemes and themes.\nSo it should be easy to add new themes without much hassle.\n\nYou can add them at the [themes folder](./home-manager/modules/style/themes/).\n\n### Creating a new secret\n\nYou need to put some secret and use it in some configuration?\n\nCheck your [secrets private repository](https://github.com/l-lin/secrets).\n\n### Adding new `zsh` completion scripts\n\nSometimes, some commands are not available in the [default zsh completions](zsh-users/zsh-completions).\n\nHowever, some tools provide a completion script that is generated for you, e.g.:\n\n```bash\njust --completion zsh\nhelm completion zsh\n```\n\nSo after adding the completion script in your `${XDG_CONFIG_HOME}/zsh/completions` folder,\nyou will notice that the completion does not work yet. It's because we are using a plugin\nthat caches the completion script. So you will need to refresh the cache by calling the\nfollowing:\n\n```bash\nrefresh-zsh-completions\n```\n\nThen, open a new terminal session, and you are good to go!\n\n---\n\n## Resources\n\nThere are lots of Nix documentation, but it's quite hard to find the \"right\"\none depending on your level of understanding of Nix.\nThe official Nix documentation delves a bit too much on the concepts (for the\nright reasons), whereas I just want to make something work fast.\n\nI found [Evertras introduction to home-manager](https://github.com/Evertras/simple-homemanager)\nis the best documentation to start with Nix, along with [zero-to-nix](https://zero-to-nix.com/).\n\n### Where to search?\n\nMost of the documentation you will search are the following:\n\n- https://search.nixos.org/packages: search Nix packages\n- https://search.nixos.org/options: search NixOS options\n- https://mynixos.com/search: search NixOS and home-manager options and packages\n- https://home-manager-options.extranix.com/: search home-manager options\n- https://nixos.wiki/index.php: more in-depth documentation\n- https://nix.dev/search.html: more in-depth documentation\n- https://nixos.org/manual/nixos/unstable/index.html#ch-configuration: system level configuration documentation\n- https://github.com/NixOS/nixpkgs: code source\n- https://noogle.dev/: search Nix functions\n\n### References\n\n- [Nix command line reference](https://nix.dev/manual/nix/2.22/command-ref/new-cli/nix)\n\n### Tutorials\n\n- [Best introduction to home-manager for newcomer](https://github.com/Evertras/simple-homemanager)\n- [Zero to Nix](https://zero-to-nix.com/)\n- [Nix pills](https://nixos.org/guides/nix-pills/)\n- [nix.dev](https://nix.dev)\n- [Installing NixOS with Hyprland](https://josiahalenbrown.substack.com/p/installing-nixos-with-hyprland)\n- [Declarative management of dotfiles with Nix and Home Manager](https://www.bekk.christmas/post/2021/16/dotfiles-with-nix-and-home-manager)\n- [Getting started with the Nix ecosystem](https://gist.github.com/thiloho/993be8693571c9868c1661ae0f3c776b)\n- [Writing Nix modules](https://nixos.org/manual/nixos/stable/#sec-writing-modules)\n- [Nix module system](https://nix.dev/tutorials/module-system/)\n- [NixOS and flake unofficial book for beginners](https://nixos-and-flakes.thiscute.world/)\n- [Nix cookbook and survival guide](https://nix4noobs.com/)\n- [Practical Nix flake anatomy](https://vtimofeenko.com/posts/practical-nix-flake-anatomy-a-guided-tour-of-flake.nix/)\n\n#### nix-darwin\n\n- [Nix-Darwin dev handbook](https://dev.jmgilman.com/environment/tools/nix/nix-darwin/)\n- [Switching to nix-darwin and flakes](https://evantravers.com/articles/2024/02/06/switching-to-nix-darwin-and-flakes/)\n- [Package management on macOS with nix-darwin](https://davi.sh/blog/2024/01/nix-darwin/)\n\n### Interesting topics\n\n- [Smaller stdenv for shells](https://discourse.nixos.org/t/smaller-stdenv-for-shells/28970)\n\n### Inspirations\n\n- https://github.com/Misterio77/nix-starter-configs\n- https://github.com/GaetanLepage/nix-config\n- https://github.com/ryan4yin/nix-config\n- https://gitlab.com/Zaney/zaneyos\n- https://github.com/notusknot/dotfiles-nix/\n- https://github.com/Evertras/nix-systems\n- https://github.com/Aylur/dotfiles\n- https://github.com/hyper-dot/Arch-Hyprland\n- https://github.com/chadcat7/crystal\n- https://codeberg.org/justgivemeaname/.dotfiles\n- https://gitlab.com/hmajid2301/dotfiles\n- https://gitlab.com/usmcamp0811/dotfiles\n- https://gitlab.com/librephoenix/nixos-config\n- https://github.com/ryan4yin/nix-darwin-kickstarter\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl-lin%2Fdotfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fl-lin%2Fdotfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl-lin%2Fdotfiles/lists"}