diff --git a/nixos/flake.nix b/nixos/flake.nix new file mode 100644 index 0000000..1f17f2e --- /dev/null +++ b/nixos/flake.nix @@ -0,0 +1,9 @@ +{ + outputs = { self, nixpkgs }: { + nixosConfigurations.danacus-yoga = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ ./systems/yoga/configuration.nix ]; + }; + }; +} + diff --git a/nixos/configuration.nix b/nixos/modules/common.nix similarity index 71% rename from nixos/configuration.nix rename to nixos/modules/common.nix index 7bc19ea..957efa5 100644 --- a/nixos/configuration.nix +++ b/nixos/modules/common.nix @@ -1,30 +1,19 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running `nixos-help`). - { config, pkgs, ... }: let home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz"; in { imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix + [ (import "${home-manager}/nixos") ]; - fileSystems."/".options = [ "compress=zstd" ]; - fileSystems."/home".options = [ "compress=zstd" ]; - fileSystems."/nix".options = [ "compress=zstd" "noatime" ]; - # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; nix.settings.experimental-features = [ "nix-command" "flakes" ]; - networking.hostName = "danacus-yoga"; # Define your hostname. - # Pick only one of the below networking options. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. @@ -88,59 +77,10 @@ in isNormalUser = true; description = "Daan Vanoverloop"; extraGroups = [ "networkmanager" "wheel" ]; - # shell = pkgs.zsh; }; home-manager.users.daan = { pkgs, ... }: { - home.username = "daan"; - home.homeDirectory = "/home/daan"; - - home.stateVersion = "23.05"; - - imports = [ ./dconf.nix ./gnome.nix ]; - - home.sessionVariables = { GTK_THEME = "Adwaita:dark"; }; - - programs.home-manager.enable = true; - - programs.helix = { - enable = true; - settings = { - theme = "onedark"; - editor = { - line-number = "relative"; - cursor-shape.insert = "bar"; - soft-wrap.enable = true; - }; - }; - }; - - programs.zsh = { - enable = true; - shellAliases = { - reload = "source ~/.zshrc"; - l = "ls -l"; - }; - sessionVariables = { - EDITOR = "hx"; - TERM = "xterm-256color"; - COLORTERM = "truecolor"; - NIX_BUILD_SHELL = "zsh"; - }; - oh-my-zsh = { - enable = true; - custom = "$HOME/.config/oh-my-zsh"; - plugins = [ - "git" "tig" "gitfast" "colorize" "command-not-found" "cp" "dirhistory" "sudo" "zsh-autosuggestions" "zsh-syntax-highlighting" "nix-shell" - ]; - theme = "avit"; - }; - }; - - home.packages = with pkgs; [ - nil - jellyfin-media-player - ]; + imports = [ "./home" ]; }; # Allow unfree packages diff --git a/nixos/dconf.nix b/nixos/modules/home/dconf.nix similarity index 100% rename from nixos/dconf.nix rename to nixos/modules/home/dconf.nix diff --git a/nixos/modules/home/default.nix b/nixos/modules/home/default.nix new file mode 100644 index 0000000..b322c22 --- /dev/null +++ b/nixos/modules/home/default.nix @@ -0,0 +1,47 @@ +{ pkgs, ... }: +{ + home.username = "daan"; + home.homeDirectory = "/home/daan"; + + home.stateVersion = "23.05"; + + imports = [ ./dconf.nix ./gnome.nix ]; + + home.sessionVariables = { GTK_THEME = "Adwaita:dark"; }; + + programs.home-manager.enable = true; + + programs.helix = { + enable = true; + settings = { + theme = "onedark"; + editor = { + line-number = "relative"; + cursor-shape.insert = "bar"; + soft-wrap.enable = true; + }; + }; + }; + + programs.zsh = { + enable = true; + shellAliases = { + reload = "source ~/.zshrc"; + l = "ls -l"; + }; + sessionVariables = { + EDITOR = "hx"; + TERM = "xterm-256color"; + COLORTERM = "truecolor"; + NIX_BUILD_SHELL = "zsh"; + }; + oh-my-zsh = { + enable = true; + custom = "$HOME/.config/oh-my-zsh"; + plugins = [ + "git" "tig" "gitfast" "colorize" "command-not-found" "cp" "dirhistory" "sudo" "zsh-autosuggestions" "zsh-syntax-highlighting" "nix-shell" + ]; + theme = "avit"; + }; + }; +} \ No newline at end of file diff --git a/nixos/gnome.nix b/nixos/modules/home/gnome.nix similarity index 100% rename from nixos/gnome.nix rename to nixos/modules/home/gnome.nix diff --git a/nixos/systems/yoga/configuration.nix b/nixos/systems/yoga/configuration.nix new file mode 100644 index 0000000..d3ba94f --- /dev/null +++ b/nixos/systems/yoga/configuration.nix @@ -0,0 +1,19 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running `nixos-help`). + +{ config, pkgs, ... }: +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ../../modules/common.nix + ]; + + fileSystems."/".options = [ "compress=zstd" ]; + fileSystems."/home".options = [ "compress=zstd" ]; + fileSystems."/nix".options = [ "compress=zstd" "noatime" ]; + + networking.hostName = "danacus-yoga"; # Define your hostname. +} + diff --git a/nixos/hardware-configuration.nix b/nixos/systems/yoga/hardware-configuration.nix similarity index 100% rename from nixos/hardware-configuration.nix rename to nixos/systems/yoga/hardware-configuration.nix