diff --git a/devel-nix/flake.lock b/devel-nix/flake.lock new file mode 100644 index 0000000..bdcb8f8 --- /dev/null +++ b/devel-nix/flake.lock @@ -0,0 +1,80 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "lastModified": 1667708081, + "narHash": "sha256-FChEy05x4ed/pttjfTeKxjPCnHknMYrUtDyBiYbreT4=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "1ef0da321217c6c19b7a30509631c080a19321e5", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1667629849, + "narHash": "sha256-P+v+nDOFWicM4wziFK9S/ajF2lc0N2Rg9p6Y35uMoZI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3bacde6273b09a21a8ccfba15586fb165078fb62", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" + } + }, + "utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/devel-nix/flake.nix b/devel-nix/flake.nix new file mode 100644 index 0000000..f0a9848 --- /dev/null +++ b/devel-nix/flake.nix @@ -0,0 +1,25 @@ +{ + description = "A very basic flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = inputs @ { self, flake-utils, nixpkgs, home-manager, ... }: + let + nixpkgsOfSys = system: import nixpkgs { inherit system; }; + in flake-utils.lib.eachDefaultSystem (sys: + { + homeConfigurations.nixos = home-manager.lib.homeManagerConfiguration { + system = sys; + # configuration = import ./home.nix; + modules = [./home.nix]; + pkgs = nixpkgs.legacyPackages.${sys}; + }; + + } + ); +} diff --git a/devel-nix/home.nix b/devel-nix/home.nix new file mode 100644 index 0000000..32a1e68 --- /dev/null +++ b/devel-nix/home.nix @@ -0,0 +1,49 @@ +# Helpful website to search for configurations: +# https://mipmip.github.io/home-manager-option-search/ +{ config, pkgs,... }: +{ + home.username = "nixos"; + home.homeDirectory = "/home/nixos"; + home.stateVersion = "22.05"; + home.packages = [pkgs.htop pkgs.wget pkgs.ripgrep]; + + # allow unfree stuffs to be installed + nixpkgs.config.allowUnfree = true; + + # define paths + xdg.enable = true; + programs.home-manager.enable = true; + programs.fzf.enable = true; + programs.neovim = { + enable = true; + viAlias = true; + vimAlias = true; + # I use vim-plug, so I probably don't require packaging + extraConfig = builtins.readFile ../neovim/init.lua; + }; + programs.zsh = { + enable = true; + shellAliases = { + ll = "ls -l"; + nix-rebuild = "sudo nixos-rebuild switch"; + }; + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + }; + }; + programs.git = { + enable = true; + lfs.enable = true; + aliases = { + a="add"; c="commit"; ca="commit --ammend"; cm="commit-m"; + lol="log --graph --decorate --pretty=oneline --abbrev-commit"; + lola="log --grpah --decorate --pretty-oneline --abbrev-commit --all"; + }; + extraConfig = { + merge = {tool="vimdiff"; conflictstyle="diff3";}; + }; + # Why is this no longer valid? + # pull = { rebase=true; }; + }; +} diff --git a/hm-base/flake.lock b/hm-base/flake.lock new file mode 100644 index 0000000..bdcb8f8 --- /dev/null +++ b/hm-base/flake.lock @@ -0,0 +1,80 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "lastModified": 1667708081, + "narHash": "sha256-FChEy05x4ed/pttjfTeKxjPCnHknMYrUtDyBiYbreT4=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "1ef0da321217c6c19b7a30509631c080a19321e5", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1667629849, + "narHash": "sha256-P+v+nDOFWicM4wziFK9S/ajF2lc0N2Rg9p6Y35uMoZI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3bacde6273b09a21a8ccfba15586fb165078fb62", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" + } + }, + "utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/hm-base/flake.nix b/hm-base/flake.nix new file mode 100644 index 0000000..f2fea67 --- /dev/null +++ b/hm-base/flake.nix @@ -0,0 +1,21 @@ +{ + description = "simple home-manager config"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = {nixpkgs, home-manager, ...}: + let system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in { + homeConfigurations.nixos = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + modules = [./home.nix]; + }; + }; +} diff --git a/hm-base/home.nix b/hm-base/home.nix new file mode 100644 index 0000000..225b51a --- /dev/null +++ b/hm-base/home.nix @@ -0,0 +1,53 @@ +{ config, pkgs,... }: +{ + home.username = "nixos"; + home.homeDirectory = "/home/nixos"; + + home.packages = [pkgs.htop pkgs.ripgrep]; + home.stateVersion = "22.05"; + nixpkgs.config.allowUnfree = true; + + programs.home-manager.enable = true; + programs.fzf.enable = true; + programs.neovim = { + enable = true; + viAlias = true; + vimAlias = true; + # I use vim-plug, so I probably don't require packaging + # extraConfig actually writes to init-home-manager.vim (not lua) + # https://github.com/nix-community/home-manager/pull/3287 + # extraConfig = builtins.readFile ../neovim/init.lua; + }; + xdg.configFile."nvim/init.lua".text = builtins.readFile ../neovim/init.lua; + programs.zsh = { + enable = true; + enableCompletion = true; + enableAutosuggestions = true; + shellAliases = { + ll = "ls -l"; + nix-rebuild = "sudo nixos-rebuild switch"; + }; + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + }; + oh-my-zsh = { + enable = true; + plugins = [ "git" "sudo" "command-not-found" "gitignore" "ripgrep" "rust" ]; + }; + }; + programs.git = { + enable = true; + lfs.enable = true; + aliases = { + a="add"; c="commit"; ca="commit --ammend"; cm="commit-m"; + lol="log --graph --decorate --pretty=oneline --abbrev-commit"; + lola="log --grpah --decorate --pretty-oneline --abbrev-commit --all"; + }; + extraConfig = { + merge = {tool="vimdiff"; conflictstyle="diff3";}; + }; + # why is this no longer valid? + # pull = { rebase=true; }; + }; +} diff --git a/system/configuration.nix b/system-nix/configuration.nix similarity index 94% rename from system/configuration.nix rename to system-nix/configuration.nix index 891e552..20bf068 100755 --- a/system/configuration.nix +++ b/system-nix/configuration.nix @@ -27,7 +27,7 @@ in }; # users.users..uid = 1000; - networking.hostName = "nixos"; + # networking.hostName = "nixos"; # Enable nix flakes nix.package = pkgs.nixFlakes; @@ -35,7 +35,7 @@ in experimental-features = nix-command flakes ''; - # Home manager + # Some basic programs programs.neovim = { enable = true; defaultEditor = true; diff --git a/system-nix/flake.lock b/system-nix/flake.lock new file mode 100644 index 0000000..c1dbbbb --- /dev/null +++ b/system-nix/flake.lock @@ -0,0 +1,63 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "lastModified": 1667708081, + "narHash": "sha256-FChEy05x4ed/pttjfTeKxjPCnHknMYrUtDyBiYbreT4=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "1ef0da321217c6c19b7a30509631c080a19321e5", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1661328374, + "narHash": "sha256-GGMupfk/lGzPBQ/dRrcQEhiFZ0F5KPg0j5Q4Fb5coxc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f034b5693a26625f56068af983ed7727a60b5f8b", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" + } + }, + "utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/system-nix/flake.nix b/system-nix/flake.nix new file mode 100644 index 0000000..c0303ec --- /dev/null +++ b/system-nix/flake.nix @@ -0,0 +1,22 @@ +{ + inputs = { + nixpkgs.url = "nixpkgs/nixos-unstable"; + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = { self, nixpkgs, ... }: { + nixosConfigurations.Felia = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./configuration.nix + ]; + }; + nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./configuration.nix + ]; + }; + }; +} diff --git a/system/hardware-configuration.nix b/system-nix/hardware-configuration.nix similarity index 100% rename from system/hardware-configuration.nix rename to system-nix/hardware-configuration.nix diff --git a/system/nixos-wsl/.envrc b/system-nix/nixos-wsl/.envrc similarity index 100% rename from system/nixos-wsl/.envrc rename to system-nix/nixos-wsl/.envrc diff --git a/system/nixos-wsl/.github/ISSUE_TEMPLATE/bug_report.md b/system-nix/nixos-wsl/.github/ISSUE_TEMPLATE/bug_report.md similarity index 100% rename from system/nixos-wsl/.github/ISSUE_TEMPLATE/bug_report.md rename to system-nix/nixos-wsl/.github/ISSUE_TEMPLATE/bug_report.md diff --git a/system/nixos-wsl/.github/ISSUE_TEMPLATE/feature_request.md b/system-nix/nixos-wsl/.github/ISSUE_TEMPLATE/feature_request.md similarity index 100% rename from system/nixos-wsl/.github/ISSUE_TEMPLATE/feature_request.md rename to system-nix/nixos-wsl/.github/ISSUE_TEMPLATE/feature_request.md diff --git a/system/nixos-wsl/.github/release-drafter.yml b/system-nix/nixos-wsl/.github/release-drafter.yml similarity index 100% rename from system/nixos-wsl/.github/release-drafter.yml rename to system-nix/nixos-wsl/.github/release-drafter.yml diff --git a/system/nixos-wsl/.github/workflows/main.yml b/system-nix/nixos-wsl/.github/workflows/main.yml similarity index 100% rename from system/nixos-wsl/.github/workflows/main.yml rename to system-nix/nixos-wsl/.github/workflows/main.yml diff --git a/system/nixos-wsl/.github/workflows/release-drafter.yml b/system-nix/nixos-wsl/.github/workflows/release-drafter.yml similarity index 100% rename from system/nixos-wsl/.github/workflows/release-drafter.yml rename to system-nix/nixos-wsl/.github/workflows/release-drafter.yml diff --git a/system/nixos-wsl/.github/workflows/update-flakes.yml b/system-nix/nixos-wsl/.github/workflows/update-flakes.yml similarity index 100% rename from system/nixos-wsl/.github/workflows/update-flakes.yml rename to system-nix/nixos-wsl/.github/workflows/update-flakes.yml diff --git a/system/nixos-wsl/.gitignore b/system-nix/nixos-wsl/.gitignore similarity index 100% rename from system/nixos-wsl/.gitignore rename to system-nix/nixos-wsl/.gitignore diff --git a/system/nixos-wsl/LICENSE b/system-nix/nixos-wsl/LICENSE similarity index 100% rename from system/nixos-wsl/LICENSE rename to system-nix/nixos-wsl/LICENSE diff --git a/system/nixos-wsl/README.md b/system-nix/nixos-wsl/README.md similarity index 100% rename from system/nixos-wsl/README.md rename to system-nix/nixos-wsl/README.md diff --git a/system/nixos-wsl/default.nix b/system-nix/nixos-wsl/default.nix similarity index 100% rename from system/nixos-wsl/default.nix rename to system-nix/nixos-wsl/default.nix diff --git a/system/nixos-wsl/flake.lock b/system-nix/nixos-wsl/flake.lock similarity index 100% rename from system/nixos-wsl/flake.lock rename to system-nix/nixos-wsl/flake.lock diff --git a/system/nixos-wsl/flake.nix b/system-nix/nixos-wsl/flake.nix similarity index 100% rename from system/nixos-wsl/flake.nix rename to system-nix/nixos-wsl/flake.nix diff --git a/system/nixos-wsl/modules/build-tarball.nix b/system-nix/nixos-wsl/modules/build-tarball.nix similarity index 100% rename from system/nixos-wsl/modules/build-tarball.nix rename to system-nix/nixos-wsl/modules/build-tarball.nix diff --git a/system/nixos-wsl/modules/docker-desktop.nix b/system-nix/nixos-wsl/modules/docker-desktop.nix similarity index 100% rename from system/nixos-wsl/modules/docker-desktop.nix rename to system-nix/nixos-wsl/modules/docker-desktop.nix diff --git a/system/nixos-wsl/modules/docker-native.nix b/system-nix/nixos-wsl/modules/docker-native.nix similarity index 100% rename from system/nixos-wsl/modules/docker-native.nix rename to system-nix/nixos-wsl/modules/docker-native.nix diff --git a/system/nixos-wsl/modules/installer.nix b/system-nix/nixos-wsl/modules/installer.nix similarity index 100% rename from system/nixos-wsl/modules/installer.nix rename to system-nix/nixos-wsl/modules/installer.nix diff --git a/system/nixos-wsl/modules/interop.nix b/system-nix/nixos-wsl/modules/interop.nix similarity index 100% rename from system/nixos-wsl/modules/interop.nix rename to system-nix/nixos-wsl/modules/interop.nix diff --git a/system/nixos-wsl/modules/wsl-distro.nix b/system-nix/nixos-wsl/modules/wsl-distro.nix similarity index 100% rename from system/nixos-wsl/modules/wsl-distro.nix rename to system-nix/nixos-wsl/modules/wsl-distro.nix diff --git a/system/nixos-wsl/syschdemd.nix b/system-nix/nixos-wsl/syschdemd.nix similarity index 100% rename from system/nixos-wsl/syschdemd.nix rename to system-nix/nixos-wsl/syschdemd.nix diff --git a/system/nixos-wsl/syschdemd.sh b/system-nix/nixos-wsl/syschdemd.sh similarity index 100% rename from system/nixos-wsl/syschdemd.sh rename to system-nix/nixos-wsl/syschdemd.sh diff --git a/system/flake.lock b/system/flake.lock deleted file mode 100644 index 9b5c68b..0000000 --- a/system/flake.lock +++ /dev/null @@ -1,26 +0,0 @@ -{ - "nodes": { - "nixpkgs": { - "locked": { - "lastModified": 1661328374, - "narHash": "sha256-GGMupfk/lGzPBQ/dRrcQEhiFZ0F5KPg0j5Q4Fb5coxc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "f034b5693a26625f56068af983ed7727a60b5f8b", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-unstable", - "type": "indirect" - } - }, - "root": { - "inputs": { - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/system/flake.nix b/system/flake.nix deleted file mode 100644 index 83907ed..0000000 --- a/system/flake.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - inputs = { - nixpkgs.url = "nixpkgs/nixos-unstable"; - }; - - outputs = { self, nixpkgs, ... }: { - nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./configuration.nix - ]; - }; - }; -}