summaryrefslogtreecommitdiff
path: root/test-vm.nix
blob: 95c80b194e52cce5e1f2e588989152af88980372 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# nix-build '<nixpkgs/nixos>' -A vm -I nixos-config ./test-vm.nix
{ config, lib, pkgs, ... }:
let
  dotfiles = ./.;
  # dotfiles = builtins.fetchGit "https://github.com/orbekk/dotfiles.git";
in
{
  fonts = {
    enableDefaultFonts = true;
    fonts = with pkgs; [ fira-code dejavu_fonts steamPackages.steam-fonts wqy_microhei ];
  };

  services.xserver = {
    enable = true;
    windowManager.xmonad = {
      enable = true;
      enableContribAndExtras = true;
      extraPackages = hpkgs: [ hpkgs.xmobar hpkgs.split ];
    };

    displayManager.autoLogin.enable = true;
    displayManager.autoLogin.user = "orbekk";
    displayManager.sddm.enable = true;
  };

  virtualisation.memorySize = 1024;
  virtualisation.diskSize = 8196;
  #virtualisation.qemu.options = [ "-full-screen -sdl" ];

  programs.zsh.enable = true;
  users.users.orbekk = {
    isNormalUser = true;
    home = "/home/orbekk";
    extraGroups = ["wheel"];
    password = "";
    shell = pkgs.zsh;
  };

  environment.systemPackages = with pkgs; [
    git
    stow
    exa
    fzf
    zoxide
    bat
    most
    dmenu
    emacs
    rxvt_unicode-with-plugins
    trayer
    xbindkeys
    xorg.xbacklight
    xorg.xev
    xscreensaver
    xsel
    xss-lock
    tmux
    ripgrep
    coreutils
    fd
  ];

  systemd.services.orbekk-setup = {
    description = "Home directory setup";
    path = config.environment.systemPackages;
    script = ''
      cd ~orbekk
      # cp -r ${dotfiles} dotfiles
      git clone https://github.com/orbekk/dotfiles.git dotfiles
      ./dotfiles/setup.sh fast
    '';
    serviceConfig = {
      User = "orbekk";
      Type = "oneshot";
      RemainAfterExit = true;
    };
    wantedBy = ["multi-user.target"];
    requiredBy = ["default.target" ];
    before = ["display-manager.service"];
    after = ["networking-online.target"];
  };
}