Git Product home page Git Product logo

dotfiles-nix's Introduction

❄️ NixOS dotfiles

My configuration files for NixOS. Feel free to look around and copy!

Special thanks to:

Screenshot of my desktop

Info

  • RAM usage on startup: ~180mb
  • Package count: 📦 582
  • Uses the jabuti theme
  • Terminal emulator: 🦶 foot
  • Window manager: 🌿 Hyprland
  • Shell: 🐚 zsh
  • Editor: 📝 neovim
  • Browser: 🦊 Firefox
  • Other: dunst, swaybg, eww, wofi

Commands to know

  • Rebuild and switch the system configuration (in the config directory):
rebuild

OR

doas nixos-rebuild switch --flake .#yourComputer --fast
  • Connect to wifi (replace stuff within brackets with your info)
iwctl --passphrase [passphrase] station [device] connect [SSID]

Installation

** IMPORTANT: do NOT use my laptop.nix and/or desktop.nix! These files include settings that are specific to MY drives and they will mess up for you if you try to use them on your system. **

Please be warned that it may not work perfectly out of the box. For best security, read over all the files to confirm there are no conflictions with your current system.

Prerequisites:

Clone the repo and cd into it:

git clone https://github.com/notusknot/dotfiles-nix ~/.config/nixos && cd ~/.config/nixos

First, create a hardware configuration for your system:

sudo nixos-generate-config

You can then copy this to a the hosts/ directory (note: change yourComputer with whatever you want):

mkdir hosts/yourComputer
cp /etc/nixos/hardware-configuration.nix ~/.config/nixos/hosts/yourComputer/

You can either add or create your own output in flake.nix, by following this template:

nixosConfigurations = {
    # Now, defining a new system is can be done in one line
    #                                Architecture   Hostname
    laptop = mkSystem inputs.nixpkgs "x86_64-linux" "laptop";
    desktop = mkSystem inputs.nixpkgs "x86_64-linux" "desktop";
    # ADD YOUR COMPUTER HERE! (feel free to remove mine)
    yourComputer = mkSystem inputs.nixpkgs "x86_64-linux" "yourComputer";
};

Next, create hosts/yourComputer/user.nix, a configuration file for your system for any modules you want to enable:

{ config, lib, inputs, ...}:

{
    imports = [ ../../modules/default.nix ];
    config.modules = {
        # gui
        hyprland.enable = true;

        # cli
        nvim.enable = true;

        # system
        xdg.enable = true;
    };
}

The above config installs and configures hyprland, nvim, and xdg user directories. Each config is modularized so you don't have to worry about having to install the software alongside it, since the module does it for you. Every available module can be found in the modules directory.

Lastly, build the configuration with

sudo nixos-rebuild switch --flake .#yourComputer

And that should be it! If there are any issues please don't hesistate to submit an issue or contact me.

Conclusion

And thats about it for my configuration. The code is registered under the MIT license, meaning you are allowed to use or distribute the code as you please, and if you need any help or have any suggestions, you can reach me on Discord at notusknot#5622 or email me at [email protected].

dotfiles-nix's People

Contributors

emberavenge avatar notusknot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dotfiles-nix's Issues

Hey! What's the colorscheme for your shell?

Hey! I love your setup! I also found your repo Dusk for the nvim colorscheme and have already switched to it. But I was wondering... is there a full colorscheme available that you use for your shell as well?

Thanks,

Workspaces.lua not working

I am not using the nix configuration, but I've stolen everything related to hyprland workspaces.

My eww config

(defwidget bar []
    (box
        :orientation "h" 
        :space-evenly false  
        :halign "end"
        :class "bar"

        (workspaces
         :halign "center"
         :hexpand false
         :orientation "h"
         :space-evenly false
        )    
        (bat)
        (bright)
        (volume)
        (wifi)
    )
)

(deflisten workspaces_listen "scripts/workspaces.sh")
(defwidget workspaces []
    (literal :content workspaces_listen)
)

and the scripts I just copy pasted into ~/.config/eww/scripts/. Both workspaces.lua and workspaces.sh

When trying to use the workspaces script, I encounter this error from eww logs

error: Input ended unexpectedly. Check if you have any unclosed delimiters
  ┌─ <literal-content>:1:227        
  │                 
1 │ (box :orientation "h" :spacing 1 :space-evenly "true" (button :class "inactive" :onclick "hyprctl dispatch workspace 1" "")(button :class "in
active" :onclick "hyprctl dispatch workspace 0" "")(button :class "active" :onclick "hyprctl dispatch workspace 
  │                                                                                                                                               
                                                                                    ─
                                    
                                    
error: Input ended unexpectedly. Check if you have any unclosed delimiters
  ┌─ <literal-content>:1:227                                                                                                                      
  │                    
1 │ (box :orientation "h" :spacing 1 :space-evenly "true" (button :class "inactive" :onclick "hyprctl dispatch workspace 1" "")(button :class "in
active" :onclick "hyprctl dispatch workspace 0" "")(button :class "active" :onclick "hyprctl dispatch workspace
error: Invalid token
  ┌─ <literal-content>:1:5
  │
1 │  " "")(button :class "inactive" :onclick "hyprctl dispatch workspace 2" "")(button :class "active" :onclick "hyprctl dispatch workspace 
  │     ─ Invalid token


error: Invalid token
  ┌─ <literal-content>:1:5
  │
1 │  " "")(button :class "inactive" :onclick "hyprctl dispatch workspace 2" "")(button :class "active" :onclick "hyprctl dispatch workspace 
  │     ─ Invalid token


error: Invalid token
  ┌─ <literal-content>:1:5
  │
1 │  " "")(button :class "inactive" :onclick "hyprctl dispatch workspace 3" "")(button :class "active" :onclick "hyprctl dispatch workspace 
  │     ─ Invalid token

error: Invalid token
  ┌─ <literal-content>:1:5
  │
1 │  " "")(button :class "inactive" :onclick "hyprctl dispatch workspace 3" "")(button :class "active" :onclick "hyprctl dispatch workspace 
  │     ─ Invalid token



error: Invalid token
  ┌─ <literal-content>:1:5
  │
1 │  " "")(button :class "inactive" :onclick "hyprctl dispatch workspace 4" "")(button :class "active" :onclick "hyprctl dispatch workspace 
  │     ─ Invalid token


error: Invalid token
  ┌─ <literal-content>:1:5
  │
1 │  " "")(button :class "inactive" :onclick "hyprctl dispatch workspace 4" "")(button :class "active" :onclick "hyprctl dispatch workspace 
  │     ─ Invalid token


error: Invalid token
  ┌─ <literal-content>:1:5
  │
1 │  " ""))
  │     ─ Invalid token


error: Invalid token
  ┌─ <literal-content>:1:5
  │
1 │  " ""))
  │     ─ Invalid token

I'm not sure if this is an error on my part or the script is outdated, please address. Thanks

Error when run `sudo nixos-rebuild switch --flake .#lk-station --show-trace`

i got this error msg when run

sudo nixos-rebuild switch --flake .#lk-station --show-trace
warning: Git tree '/home/lk/.config/nixos' is dirty
warning: input 'nur' has an override for a non-existent input 'nixpkgs'
error: getting status of '/nix/store/6w1xm6chg79qpkzlngdraj2i2pf5c7a8-source/hosts/lk-station': No such file or directory

       … while realising the context of path '/nix/store/6w1xm6chg79qpkzlngdraj2i2pf5c7a8-source/hosts/lk-station/hardware-configuration.nix'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:376:99:

          375|           throw "Module imports can't be nested lists. Perhaps you meant to remove one level of lists? Definitions: ${showDefs defs}"
          376|         else unifyModuleSyntax (toString m) (toString m) (applyModuleArgsIfFunction (toString m) (import m) args);
             |                                                                                                   ^
          377|

       … while evaluating 'isFunction'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/trivial.nix:448:16:

          447|   */
          448|   isFunction = f: builtins.isFunction f ||
             |                ^
          449|     (f ? __functor && isFunction (f.__functor f));

       … from call site

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:474:78:

          473|
          474|   applyModuleArgsIfFunction = key: f: args@{ config, options, lib, ... }: if isFunction f then
             |                                                                              ^
          475|     let

       … while evaluating 'applyModuleArgsIfFunction'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:474:39:

          473|
          474|   applyModuleArgsIfFunction = key: f: args@{ config, options, lib, ... }: if isFunction f then
             |                                       ^
          475|     let

       … from call site

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:376:59:

          375|           throw "Module imports can't be nested lists. Perhaps you meant to remove one level of lists? Definitions: ${showDefs defs}"
          376|         else unifyModuleSyntax (toString m) (toString m) (applyModuleArgsIfFunction (toString m) (import m) args);
             |                                                           ^
          377|

       … while evaluating 'unifyModuleSyntax'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:443:34:

          442|      of ‘options’, ‘config’ and ‘imports’ attributes. */
          443|   unifyModuleSyntax = file: key: m:
             |                                  ^
          444|     let

       … from call site

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:376:14:

          375|           throw "Module imports can't be nested lists. Perhaps you meant to remove one level of lists? Definitions: ${showDefs defs}"
          376|         else unifyModuleSyntax (toString m) (toString m) (applyModuleArgsIfFunction (toString m) (import m) args);
             |              ^
          377|

       … while evaluating 'loadModule'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:370:53:

          369|       # Like unifyModuleSyntax, but also imports paths and calls functions if necessary
          370|       loadModule = args: fallbackFile: fallbackKey: m:
             |                                                     ^
          371|         if isFunction m || isAttrs m then

       … from call site

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:411:22:

          410|           let
          411|             module = loadModule args parentFile "${parentKey}:anon-${toString n}" x;
             |                      ^
          412|             collectedImports = collectStructuredModules module._file module.key module.imports args;

       … while evaluating the attribute 'disabled'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:406:13:

          405|           collectResults = modules: {
          406|             disabled = concatLists (catAttrs "disabled" modules);
             |             ^
          407|             inherit modules;

       … while evaluating anonymous lambda

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:428:31:

          427|           disabledKeys = map moduleKey disabled;
          428|           keyFilter = filter (attrs: ! elem attrs.key disabledKeys);
             |                               ^
          429|         in map (attrs: attrs.module) (builtins.genericClosure {

       … from call site

       … while evaluating 'filterModules'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:424:36:

          423|       # modules recursively. It returns the final list of unique-by-key modules
          424|       filterModules = modulesPath: { disabled, modules }:
             |                                    ^
          425|         let

       … from call site

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:435:7:

          434|     in modulesPath: initialModules: args:
          435|       filterModules modulesPath (collectStructuredModules unknownModule "" initialModules args);
             |       ^
          436|

       … while evaluating anonymous lambda

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:434:37:

          433|
          434|     in modulesPath: initialModules: args:
             |                                     ^
          435|       filterModules modulesPath (collectStructuredModules unknownModule "" initialModules args);

       … from call site

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:280:25:

          279|       merged =
          280|         let collected = collectModules
             |                         ^
          281|           (specialArgs.modulesPath or "")

       … while evaluating 'reverseList'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/lists.nix:394:17:

          393|   */
          394|   reverseList = xs:
             |                 ^
          395|     let l = length xs; in genList (n: elemAt xs (l - n - 1)) l;

       … from call site

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:284:33:

          283|           ({ inherit lib options config specialArgs; } // specialArgs);
          284|         in mergeModules prefix (reverseList collected);
             |                                 ^
          285|

       … while evaluating 'byName'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:550:25:

          549|       */
          550|       byName = attr: f: modules:
             |                         ^
          551|         zipAttrsWith (n: concatLists)

       … from call site

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:567:21:

          566|       # an attrset 'name' => list of submodules that declare ‘name’.
          567|       declsByName = byName "options" (module: option:
             |                     ^
          568|           [{ inherit (module) _file; options = option; }]

       … while evaluating the attribute 'matchedOptions'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:646:14:

          645|     in {
          646|       inherit matchedOptions;
             |              ^
          647|

       … while evaluating 'mapAttrsRecursiveCond'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/attrsets.nix:393:36:

          392|   */
          393|   mapAttrsRecursiveCond = cond: f: set:
             |                                    ^
          394|     let

       … from call site

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:292:28:

          291|           # For definitions that have an associated option
          292|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                            ^
          293|

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.