From fde5042fe113f95b655bae79bf11b3a80647681f Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Mon, 16 Jan 2023 00:55:12 -0500 Subject: [PATCH] Tyrel MicroPC --- home/ssh/tyrel-micropc.pub | 1 + hosts/tyrel-MicroPC/default.nix | 4 ++ hosts/tyrel-MicroPC/flake.lock | 64 ++++++++++++++++++++++++++++ hosts/tyrel-MicroPC/flake.nix | 36 ++++++++++++++++ hosts/tyrel-MicroPC/home-manager.nix | 15 +++++++ hosts/tyrel-MicroPC/home.nix | 12 ++++++ justfile | 14 +++++- 7 files changed, 144 insertions(+), 2 deletions(-) create mode 100644 home/ssh/tyrel-micropc.pub create mode 100644 hosts/tyrel-MicroPC/default.nix create mode 100644 hosts/tyrel-MicroPC/flake.lock create mode 100644 hosts/tyrel-MicroPC/flake.nix create mode 100644 hosts/tyrel-MicroPC/home-manager.nix create mode 100644 hosts/tyrel-MicroPC/home.nix diff --git a/home/ssh/tyrel-micropc.pub b/home/ssh/tyrel-micropc.pub new file mode 100644 index 0000000..8d43686 --- /dev/null +++ b/home/ssh/tyrel-micropc.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMaa6hZpIi7B6hsyA7EDBZjkGe0y4+EQD1kvVRickbka tyrel@tyrel-MicroPC diff --git a/hosts/tyrel-MicroPC/default.nix b/hosts/tyrel-MicroPC/default.nix new file mode 100644 index 0000000..8c55841 --- /dev/null +++ b/hosts/tyrel-MicroPC/default.nix @@ -0,0 +1,4 @@ +{ pkgs, config, lib, ... }: +{ + programs.zsh.enable = true; +} diff --git a/hosts/tyrel-MicroPC/flake.lock b/hosts/tyrel-MicroPC/flake.lock new file mode 100644 index 0000000..7e2d60f --- /dev/null +++ b/hosts/tyrel-MicroPC/flake.lock @@ -0,0 +1,64 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "lastModified": 1672688183, + "narHash": "sha256-3sNEWKTg3XXVDnvzVatdyetiUQWL+ibJ1YkvxSk3PuM=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "c1a830c8fabb13f95f51ecf48552f0a794d8718a", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1672525397, + "narHash": "sha256-WASDnyxHKWVrEe0dIzkpH+jzKlCKAk0husv0f/9pyxg=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "8ba56d7c0d7490680f2d51ba46a141eca7c46afa", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "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/hosts/tyrel-MicroPC/flake.nix b/hosts/tyrel-MicroPC/flake.nix new file mode 100644 index 0000000..01e3aa3 --- /dev/null +++ b/hosts/tyrel-MicroPC/flake.nix @@ -0,0 +1,36 @@ +{ + description = "Tyrel Nix"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + }; + outputs = { self, nixpkgs, home-manager } : + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in { + defaultPackage.x86_64-linux = home-manager.defaultPackage.x86_64-linux; + homeConfigurations = { + "tyrel" = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + + modules = [ + ./default.nix + ./home-manager.nix + { + home = { + homeDirectory = "/home/tyrel"; + username = "tyrel"; + stateVersion = "22.05"; + }; + } + ]; + + + }; + }; + }; +} + diff --git a/hosts/tyrel-MicroPC/home-manager.nix b/hosts/tyrel-MicroPC/home-manager.nix new file mode 100644 index 0000000..e0af78a --- /dev/null +++ b/hosts/tyrel-MicroPC/home-manager.nix @@ -0,0 +1,15 @@ +{ pkgs, ... }: +{ + # Common Imports + imports = [ + ./home.nix + ../_common/home.nix + ../_common/programs.nix + ../_common/xdg.nix + ]; + home.sessionVariables = { + XDG_CONFIG_HOME = "/home/tyrel/.config"; + }; + + +} diff --git a/hosts/tyrel-MicroPC/home.nix b/hosts/tyrel-MicroPC/home.nix new file mode 100644 index 0000000..a57c409 --- /dev/null +++ b/hosts/tyrel-MicroPC/home.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: +{ + home.stateVersion = "22.05"; + home.sessionVariables = { + }; + home.packages = with pkgs; [ + ]; + + home.file = { + }; + +} diff --git a/justfile b/justfile index 35b6393..e580f1f 100644 --- a/justfile +++ b/justfile @@ -3,6 +3,16 @@ # Naive check if /Users or /home for home. OS := if "${HOME}" =~ '/U.*' { "macos" } else { "ubuntu" } HOSTNAME := `hostname| sed 's/.local//'` +NIXPATH := "nixpkgs=/nix/var/nix/profiles/per-user/tyrel/channels/nixpkgs:/nix/var/nix/profiles/per-user/tyrel/channels" + +setup: + just setup-{{OS}} + +setup-ubuntu: + NIX_PATH={{NIXPATH}} nix-channel --add https://nixos.org/channels/nixos-22.11 nixos + NIX_PATH={{NIXPATH}} nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.11.tar.gz home-manager + NIX_PATH={{NIXPATH}} nix-channel --update + NIX_PATH={{NIXPATH}} nix-shell '' -A install git-add: git add . @@ -30,5 +40,5 @@ rebuild-macos: ./result/sw/bin/darwin-rebuild switch --flake ./hosts/{{HOSTNAME}} rebuild-ubuntu: - NIX_PATH=nixpkgs=/nix/var/nix/profiles/per-user/tyrel/channels/nixpkgs:/nix/var/nix/profiles/per-user/tyrel/channels nix run ./hosts/{{HOSTNAME}} switch -vv - NIX_PATH=nixpkgs=/nix/var/nix/profiles/per-user/tyrel/channels/nixpkgs:/nix/var/nix/profiles/per-user/tyrel/channels home-manager switch --flake ./hosts/{{HOSTNAME}} + NIX_PATH={{NIXPATH}} nix run ./hosts/{{HOSTNAME}} switch -vv + NIX_PATH={{NIXPATH}} home-manager switch --flake ./hosts/{{HOSTNAME}}