From 55bba2a8abab2198e0a65ecab99a6b2190d05783 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Sun, 20 Aug 2023 00:11:19 +0200 Subject: [PATCH] Nix OS flake update --- flake.nix | 14 +++++++++++--- home.nix | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 home.nix diff --git a/flake.nix b/flake.nix index d782220..2cc8ebd 100644 --- a/flake.nix +++ b/flake.nix @@ -9,13 +9,21 @@ }; }; - outputs = { self, nixpkgs, ... }@inputs: { + outputs = inputs@{ nixpkgs, home-manager, ... }: { nixosConfigurations = { - "nixos-test" = nixpkgs.lib.nixosSystem { + # nixos => hostname + nixos = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - modules = [ ./configuration.nix + + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + + home-manager.users.florian = import ./home.nix; + } ]; }; }; diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..943a5dd --- /dev/null +++ b/home.nix @@ -0,0 +1,35 @@ +{ config, pkgs, ... }: + +{ + home.username = "florian"; + home.homeDirectory = "/home/florian"; + + # link the configuration file in current directory to the specified location in home directory + # home.file.".config/i3/wallpaper.jpg".source = ./wallpaper.jpg; + + # link all files in `./scripts` to `~/.config/i3/scripts` + # home.file.".config/i3/scripts" = { + # source = ./scripts; + # recursive = true; # link recursively + # executable = true; # make all files executable + # }; + + # encode the file content in nix configuration file directly + # home.file.".xxx".text = '' + # xxx + # ''; + + programs.git = { + enable = true; + userName = "Florian RICHER"; + userEmail = "florian.richer@protonmail.com"; + }; + + home.packages = with pkgs; [ + vim + ]; + + home.stateVersion = "23.05"; + + programs.home-manager.enable = true; +} \ No newline at end of file